this list is not for newbie questions, I strongly
recommend you to read the OpenGL red book,
and to see these OpenGL discussion forums:
>I must not understand how the matrix stack is being used. It
>looks like you push something on, create a new top entry and then pop it
>off such that it is lost. Where does it pop to?
The PushMatrix creates a second instance of the current matrix
up in the stack, then Rotate, etc, modify the current matrix,
The PopMatrix moves down the second instance of the matrix to
the first stack position, efectively destroying the modified
matrix and giving you again the original, pristine, matrix,
the whole effect is, every rotation you start with the original
matrix. In particular this avoids the numerical accuracies that
you would be accumulating if you were to preserve the matrix
and just multipling it by the new angle increment.
> glRotatef(spin, 0.0, 0.0, 1.0);
> glColor3f(1.0, 1.0, 1.0);
> glRectf(-25.0, -25.0, 25.0, 25.0);
Get latest updates about Open Source Projects, Conferences and News.