CPSC310A
Video Game Development

Assignment 0

Loading Models

Details

Create a class called Model that represents a 3D model and contains the following methods:

Model()

Creates a new empty Model object.

void load(string objFileName)

Loads the specified Wavefront obj file as a OpenGL vertex buffer object. If this model has already loaded an obj file, the old vertex buffer object is deleted before the new model is loaded. This method only reads vertex and face lines of obj files. The face lines must contain only vertex indices and must only specify triangles. This method assumes that an OpenGL context and window have been created.

void draw()

Draw this model using OpenGL and glDrawArrays. This method assumes that an OpenGL context and window have been created. Note, all triangles in the model will be drawn the same color.

Submission

Your program will be evaluated for both style and functionality. Submit your code and test data as a tar file on cseval before class on Monday January 27th.