Asg 4: Go textured 3D

Objectives

Implement a program to render a textured 3D object that rotates in place and translates.

Assignment

  1. Texture map your 3D object from the previous assignment:
    1. a single texture mapped onto all object faces is fine, you can build on this if you like and use multiple textures, or textures packed into one large image, etc.
    2. the key to this assignment is replicating the texture coordinates at each vertex—this can be done either via vertex packing into one vertex buffer object or setting up two vertex buffers; the point is that there should be as many texture coords as there are vertices, you cannot use two element buffer object indices

Suggestions

  1. Your aw_t C++ class could provide a pack member function that assembles all the position, texture and normal coordinates into one large GLFloat array. the geometry data read in from the .obj file.
  2. If you use vertex packing, take care to adjust the stride and offset vertex attributes depending on whether the .obj file has texture and normal coordinates (it might not).
  3. How to start?
    1. start by rendering your textured quad in 3D, i.e., set up the perspective and view matrices and test this first
    2. you will likely need to expand your C++ parser for reading in the .obj file, e.g., you should now take care of handing the vt, vn coordinates if any. Remember that the format for the face data can be:
      		f [v | v/vt | v//vn | v/vt/vn ]
      		

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., passthru.vert and passthru.frag.
  3. 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).

Output

  1. The object should rotate and translate correctly.

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