Tom Kelliher, CS 320
Mar. 2, 1998
Announcements: Pong hand-out.
From last time:
Outline:
Assignment: Read Chapter 6. (Consider Chapters 1 through 6, sans 3, having been assigned.)
Are our viewing volume coordinates relative or absolute?
Consider:

looking down the -z axis.
glOrtho(-10.0, 10.0, -5.0, 5.0, -2.0, 2.0);mean?
glFrustum: same parameters as glOrtho. What's a
frustum? Truncated pyramid.
gluPerspective: fovy, aspect ratio, zNear, and zFar.
View specification:
gluLookAt() in cubeview.c:
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* Update viewer position in modelview matrix */
glLoadIdentity();
gluLookAt(viewer[0],viewer[1],viewer[2], 0.0, 0.0, 0.0,
0.0, 1.0, 0.0);
/* rotate cube */
glRotatef(theta[0], 1.0, 0.0, 0.0);
glRotatef(theta[1], 0.0, 1.0, 0.0);
glRotatef(theta[2], 0.0, 0.0, 1.0);
colorcube();
glFlush();
glutSwapBuffers();
}
Note order of matrix multiplications: view, then model transformations.
Problems with viewer movement in cubeview:
Consider this model:

, what's
and
?