MANIPULATING THE CURRENT MATRIX
-
-
E.g., if the current matrix is M,
and you invoke
where vN is a pointer to a 4x4 matrix array N,
then the new current matrix is MN.
--
Call this a right multiplication by N.
-
-
Note that in the sequence of matrix transformations
glMatrixMode(GL_MODELVIEW);
glMultMatrix( vN1);
glMultMatrix( vN2);
glMultMatrix( vN3);
|
---|
we are really transforming a vertex V in the model
in reverse order:
--
first by N3, then by N2 and finally by N1.
-
-
The model view matrix (M) is a combination of
view transformation (N1) and
global transformations (N2).
--
Then, M=N1.N2 (and not the other way round).
--
Hence, we normally begin by specifying N1 first in the program,
even though, logically, it occurs after all the other global
transformations N2 have taken place.
-
-
The model view, projection and texture matrices
have associated stacks. You can push
and pop from this stack. Thus you can save
or restore these matrices.