Asg 7: Camera!

Objectives

Implement a program to render a 3D object (textured or not) that rotates in place and translates, and where its face and vertex normals are displayed, is lit using Phong lighting, and where you can manipulate the camera in 6DOF (3 translations and 3 rotations).

Assignment

  1. Implement a cam_t C++ camera object to allow manipulation of the camera:
    1. the camera object should store the pos, ref, and vup parameters that are used in the lookAt function to set up the view matrix.
    2. use whatever glfw user input you find appealing so long as you provide the information in a README file

Suggestions

  1. Your cam_t C++ class should include functions for:
    1. camera rotations (pan, tilt, roll)
    2. camera translations (truck, dolly, pedestal)
    3. camera reset to the default orientation, tied to the R keyboard key
  2. To get appreciable rotation of the referrence point, you should place it fairly far away, e.g., at (0,0,-1000.0).

Input

  1. Use our pyramid.obj file that we came up with in class as input.
  2. You will need to read in both vertex and fragment shaders from files, e.g., phong.vert and phong.frag.
  3. You will also need to read in all three vertex, geometry, and fragment shaders from files, e.g., normals.vert, normals.geom, and normals.frag.
  4. Make sure to include an image file your program is to read as the texture (you could use our ppm_t class for *.ppm images of the stb class from the learnopengl tutorial) if you choose to texture map your object.
  5. You will need to send to your Phong shader the camera position, light position, and you will need to split up your MVP matrix into its constituent parts, namely M, V, and P.

Output

  1. The object should rotate and translate correctly.
  2. The camerea should rotate and translate correctly, allowing full 360 degree rotation.

Supplemental

  1. Provide a Makefile with a README if there any special program running instructions.

Turn in

Turn in all of your code, in one tar.gz archive of your asg##/ directory, including:
  1. A README file containing
    1. Course id--section no
    2. Name
    3. Brief solution description (e.g., program design, description of algorithm, etc., however appropriate).
    4. Lessons learned, identified interesting features of your program
    5. Any special usage instructions
  2. Makefile
  3. source code (.h headers and .cpp source)
  4. object code (do a make clean before tar)

How to hand in

See handin notes

Grading scheme