CS312 Lab 3: Viewing and projections
- Copy the demo executable projection from ~dxu/handouts/cs312/gldemo to your own directory. Run. projection relies on having data/ in the same directory, which you should have copied for the transformation demo in the last lab. If you do not have data/, you can copy it again.
- Keyboard commands if you can not get right-click to work:
- 'o' - glOrtho
- 'f' - glFrustum
- 'p' - glPersepective
- 'r' - reset parameters
- Write a program to display a cube. Use some perspective projection of your choice. Note that you should either draw the cube entirely in wireframe, or draw the same cube also in wireframe on top of it, in a different color. Otherwise everything is drawn with the same color, it will be very difficult to see the 3D shape of the cube. You can also draw each face in a different color.
- Draw an additional tetrahedron in the scene, centered on the same spot as your cube, so that you have some object overlap. Make sure your depth tests are turned on!
- Use gluLookAt to rotate the camera around the cube and tetrahedron, that is, do not use any glTranslate, glRotate, etc.