Difference between revisions of "Project2S16"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(1. 3D Model Loader)
(1. 3D Model Loader)
Line 19: Line 19:
 
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: <br><pre>f 31514//31514 31465//31465 31464//31464</pre>
 
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: <br><pre>f 31514//31514 31465//31465 31464//31464</pre>
  
Modify your parser so that you also parse for faces.
+
Modify your OBJ loader so that it also parses for triangles.
  
 
[to be continued]
 
[to be continued]

Revision as of 18:09, 8 April 2016

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 OBJ loader so that it also parses for triangles.

[to be continued]