Using Geometric Transformations

[Angel p196-201]

Suppose we wish to setup the following transformation:

  M = trans(2,1,0) rot(z,-90) scale(2,2,2)
One way of doing this:
  glMatrixMode( GL_MODELVIEW );
  glLoadIdentity();
  glTranslatef(2.0, 1.0, 0.0);
  glRotatef( -90, 0.0, 0.0, 1.0); 
  glScalef(2.0, 2.0, 2.0);
Another way:
  glMatrixMode( GL_MODELVIEW );
  M[0][0] = 2; 
  M[0][[1]= -1;
  ...
  glLoadMatrixf( M );
Applying the transformation:
  glBegin(GL_POLYGON);
    glVertex3fv( vertex_list[i] );
    glVertex3f( x,y,z );
    glVertex2f( x,y );
  glEnd();

Transformation Hierarchies

[Angel p421-435]