ModelView Transformation § Will the snippets below generate same results? § Think of glRotate, glTranslate, glScale as matrix multiplication to the current (ModelView) matrix § OpenGL does post-multiplication: MVnew = MVold * M glTranslatef (10.0f, 0.0f, 0.0f); glRotatef (45.0f, 0.0f, 0.0f, 1.0f); // draw a cube glRotatef (45.0f, 0.0f, 0.0f, 1.0f); glTranslatef (10.0f, 0.0f, 0.0f); // draw a cube
Projection Transformations § determine how a scene is mapped onto the computer screen. § The projection transformation specifies the mechanics of how the mapping should occur, and § 2D Orthographic Projection: Viewing volume is a clipping rectangle. § gluOrtho2D (left, right, bottom, top)
Reading for Project 1 § Required Reading: Red Book: ch3 p73-p78, shows you the underlying OpenGL matrix multiplication scheme. This is essential, though not obvious. § Tips: there is no 2D translation, rotation and scale in OpenGL. Instead, think of your 2D scene as projected onto x-y plane § You may not have to set up your camera and call gluLookAt in your 1st 2D project, but do read about 3D viewing for your future projects § Required Reading: Red Book: ch3 p86-p92 § Tips: Do not mess with glDepthRange, if you are not confident about Z-depth value § Suggested Reading: example 3-4 to understand matrix stack § Suggested Reading: example 3-6, 3-7 to assembly everything in Chapter 3 § A summary of GLUT functions you may need to create a display application: Hearn Baker p341