- float flash = 0.5;
- if( fmod(sgEnviro.elapsed_time*100.0, 100.0) > 50.0 )
- flash = sg_random() * 0.75f + 0.25f;
- float h = lt_tree[0].pt[PY];
- sgVec4 col={0.62f, 0.83f, 1.0f, 1.0f};
- sgVec4 c;
-
-#define DRAW_SEG() \
- {glColorMaterial(GL_FRONT, GL_EMISSION); \
- glDisable(GL_LINE_SMOOTH); glBegin(GL_LINES); \
- glColor4fv(c); \
- glVertex3f(lt_tree[n].pt[PX], lt_tree[n].pt[PZ], lt_tree[n].pt[PY]); \
- glVertex3f(lt_tree[lt_tree[n].prev].pt[PX], lt_tree[lt_tree[n].prev].pt[PZ], lt_tree[lt_tree[n].prev].pt[PY]); \
- glEnd(); glEnable(GL_LINE_SMOOTH);}
-
- glDepthMask( GL_FALSE );
- glEnable(GL_BLEND);
- glBlendFunc( GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
- glBindTexture(GL_TEXTURE_2D, 0);
-
- glDisable(GL_LIGHTING);
- glDisable( GL_FOG );
- glPushMatrix();
- sgMat4 modelview, tmp;
- // OSGFIXME
-// ssgGetModelviewMatrix( modelview );
- sgCopyMat4( tmp, sgEnviro.transform );
- sgPostMultMat4( tmp, modelview );
- // OSGFIXME
-// ssgLoadModelviewMatrix( tmp );
-
- Point3D start( sgEnviro.last_lon*SG_DEGREES_TO_RADIANS, sgEnviro.last_lat*SG_DEGREES_TO_RADIANS, 0.0 );
- Point3D dest( lon*SG_DEGREES_TO_RADIANS, lat*SG_DEGREES_TO_RADIANS, 0.0 );
- double course = 0.0, dist = 0.0;
- calc_gc_course_dist( dest, start, &course, &dist );
- double ax = 0.0, ay = 0.0;
- ax = cos(course) * dist;
- ay = sin(course) * dist;
-
- glTranslatef( ax, ay, -sgEnviro.last_alt );
-
- sgEnviro.radarEcho.push_back( SGWxRadarEcho ( course, 0.0, 0.0, dist, 0.0, age, true, 0, false ) );
-
- for( int n = 0 ; n < nb_tree ; n++ ) {
- if( lt_tree[n].prev < 0 )
- continue;
-
- float t1 = sgLerp(0.5, 1.0, lt_tree[n].pt[PY] / h);
- t1 *= flash;
- if( lt_tree[n].depth >= 2 ) {
- glLineWidth(3);
- sgScaleVec4(c, col, t1 * 0.6f);
- DRAW_SEG();
- } else {
- if( lt_tree[n].depth == 0 ) {
- glLineWidth(12);
- sgScaleVec4(c, col, t1 * 0.5f);
- DRAW_SEG();
-
- glLineWidth(6);
- sgScaleVec4(c, col, t1);
- DRAW_SEG();
- } else {
- glLineWidth(6);
- sgScaleVec4(c, col, t1 * 0.7f);
- DRAW_SEG();
- }
-
- if( lt_tree[n].depth == 0 )
- glLineWidth(3);
- else
- glLineWidth(2);
-
- sgSetVec4(c, t1, t1, t1, t1);
- DRAW_SEG();
- }
-
- }
- glLineWidth(1);
- glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
- glPopMatrix();
- glDepthMask( GL_TRUE );
- glEnable( GL_FOG );
- glEnable(GL_LIGHTING);