CS312 Lab 3: Viewing and projections

 

  1. 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.
    1. Keyboard commands if you can not get right-click to work:
      1. 'o' - glOrtho
      2. 'f' - glFrustum
      3. 'p' - glPersepective
      4. 'r' - reset parameters
  2. 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.
  3. 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!
  4. Use gluLookAt to rotate the camera around the cube and tetrahedron, that is, do not use any glTranslate, glRotate, etc.