]> git.mxchange.org Git - flightgear.git/commitdiff
Sun now correctly placed in sky and correctly colored.
authorcurt <curt>
Thu, 2 Mar 2000 19:20:54 +0000 (19:20 +0000)
committercurt <curt>
Thu, 2 Mar 2000 19:20:54 +0000 (19:20 +0000)
src/Main/main.cxx

index 16371bfb06dbf710f1fc268f09aab303907952b5..4b2341a7239561b9a0fc532f50f03c54365f7de2 100644 (file)
@@ -203,6 +203,7 @@ void fgBuildRenderStates( void ) {
     default_state->disable( GL_BLEND );
     default_state->disable( GL_ALPHA_TEST );
     default_state->disable( GL_LIGHTING );
+    default_state->setMaterial( GL_AMBIENT_AND_DIFFUSE, 1.0, 1.0, 1.0, 1.0 );
 
     hud_and_panel = new ssgSimpleState;
     hud_and_panel->disable( GL_CULL_FACE );
@@ -376,9 +377,14 @@ void fgRenderFrame( void ) {
 
        // draw the sun
        current_sun.repaint( cur_light_params.sun_angle );
-       cout << "ra = " << ephem.getSunRightAscension() << " dec = " 
-            << ephem.getSunDeclination() << endl;
-       current_sun.reposition( ephem.getSunRightAscension(),
+        sgVec3 view_pos;
+       sgSetVec3( view_pos,
+                  current_view.get_view_pos().x(),
+                  current_view.get_view_pos().y(),
+                  current_view.get_view_pos().z() );
+       current_sun.reposition( view_pos,
+                               t->getGst() * 15.041085,
+                               ephem.getSunRightAscension(),
                                ephem.getSunDeclination() );
        current_sun.draw();