corrected bug into the drawsphere (thanks to nico and guido!)

This commit is contained in:
Paolo Cignoni 2007-10-22 14:39:54 +00:00
parent 6144006bfd
commit f30329419b
1 changed files with 16 additions and 18 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.6 2007/08/17 09:19:40 cignoni
glEnable (GL_LINE_SMOOTH) should go before changing the linewidth.
Revision 1.5 2007/07/14 12:44:40 benedetti Revision 1.5 2007/07/14 12:44:40 benedetti
Minor edits in Doxygen documentation. Minor edits in Doxygen documentation.
@ -646,7 +649,6 @@ void DrawCircle ()
DrawPlaneHandle (); DrawPlaneHandle ();
} }
// nota: non ho scritto io questa funzione.
/*! /*!
@brief Draw a spherical manipulator icon. @brief Draw a spherical manipulator icon.
@ -655,6 +657,8 @@ void DrawCircle ()
*/ */
void DrawSphereIcon (Trackball * tb,bool active) void DrawSphereIcon (Trackball * tb,bool active)
{ {
glPushAttrib (GL_TRANSFORM_BIT |GL_ENABLE_BIT | GL_LINE_BIT | GL_CURRENT_BIT | GL_LIGHTING_BIT);
glMatrixMode(GL_MODELVIEW);
glPushMatrix (); glPushMatrix ();
glTranslate (tb->center); glTranslate (tb->center);
glMultMatrix (tb->track.InverseMatrix ()); glMultMatrix (tb->track.InverseMatrix ());
@ -663,10 +667,8 @@ void DrawSphereIcon (Trackball * tb,bool active)
tb->track.rot.ToMatrix (r); tb->track.rot.ToMatrix (r);
glMultMatrix (r); glMultMatrix (r);
glPushMatrix ();
float amb[4] = { .3f, .3f, .3f, 1.0f }; float amb[4] = { .3f, .3f, .3f, 1.0f };
float col[4] = { .5f, .5f, .8f, 1.0f }; float col[4] = { .5f, .5f, .8f, 1.0f };
glPushAttrib (GL_ENABLE_BIT | GL_LINE_BIT | GL_CURRENT_BIT | GL_LIGHTING_BIT);
glEnable (GL_LINE_SMOOTH); glEnable (GL_LINE_SMOOTH);
if (active) if (active)
glLineWidth (DH.LineWidthMoving); glLineWidth (DH.LineWidthMoving);
@ -679,19 +681,15 @@ void DrawSphereIcon (Trackball * tb,bool active)
glColor (DH.color); glColor (DH.color);
glMaterialfv (GL_FRONT_AND_BACK, GL_EMISSION, amb); glMaterialfv (GL_FRONT_AND_BACK, GL_EMISSION, amb);
glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, col); glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, col);
glPushMatrix ();
DrawCircle (); DrawCircle ();
glPushMatrix ();
glRotatef (90, 1, 0, 0); glRotatef (90, 1, 0, 0);
DrawCircle (); DrawCircle ();
glRotatef (90, 0, 1, 0); glRotatef (90, 0, 1, 0);
DrawCircle (); DrawCircle ();
glPopMatrix ();
glPopMatrix (); glPopMatrix ();
glPopAttrib (); glPopAttrib ();
glPopMatrix ();
glPopMatrix ();
} }
// TEMPORARY drawing section // TEMPORARY drawing section