Project2S16

From Immersive Visualization Lab Wiki
Revision as of 19:08, 8 April 2016 by Jschulze (Talk | contribs)

Jump to: navigation, search

Project 2: 3D Models

From this point on we're no longer using the rasterizer code. In all future homework projects we're going to use OpenGL for all our rendering.

In this homework assignment you're going to learn how to:

  • load polygonal OBJ files
  • render polygons in modern OpenGL
  • automatically center and scale 3D models
  • set up the virtual camera
  • control the camera with the mouse
  • set up light sources
  • set material properties

1. 3D Model Loader

You already know how to load point clouds. It turns out that the 3D model files from project 1 (Bunny, Bear, Dragon) contain surface descriptions as well, by means of triangle connectivity.

Besides vertices and vertex normals you are going to have to parse the files for connectivity. It is defined with the letter 'f' for face. Each line starting with the letter 'f' lists three sets of indices to vertices and normals, which define the three corners of a triangle. The numbers are indices into the vertex and vertex normal lists. Example:
f 31514//31514 31465//31465 31464//31464

Modify your parser so that you also parse for faces.

[to be continued]