17. Homework
• Take your model and render it using
perspective projection.
• Make more than one appear on the screen
in different places, sizes, rotations.
• Bonus points if you animate it.
Notas do Editor
Z goes negative away from the camera. This is the coordinates you start with before you have three transformations - the View, Model and Projection.
View Transformation - represents the camera. You must specify the view transformation before any others, because all other transformations are relative to it. Typically at 0,0,0 going down the z axis.
Models. This is what you’ll primarily be doing. Translate - then rotate! If you rotate first you are changing the coordinate system. You’ll move differently than you think.
MODELVIEW:
If you imagine the camera as an invisible object, there’s really no difference. No difference in moving camera in negative z, or moving the scene in positive z.
By convention the initial transformation provides a frame of reference for all further transformations.
MODELVIEW
Imagine the camera is an invisible object that you place first.
So each vertex you specify is represented, internally, as a 1x4 matrix. This is multiplied first by the ModelView matrix. That yields a transformed eye coordinate. That is then Multiplied by the Projection matrix. That gives you the coordinates before clipping. It gets clipped (perspective division) and finally transformed again to the viewport. Fortunately you only worry about the first two steps.
The identity matrix. Resets the matrices.
OpenGL Supports Matrix Stacks as well - you can push and pop if you like, useful if you’ve already calculated a bunch of transforms and don’t want to mess up.