Assignment 1: Due October 26, 2018 at 11:59:59 pm

Overview

The purpose of this assignment is to make use of the material taught in class and the practical exercises we have been doing in the labs.

Your task is to load a textured and lit model stored in an .OBJ file, and allow the user to view it with arcball controls. The expectation is that the user can provide the obj file name on the command line, your program will find the file and load it with the provided obj and bmp loading code and display it in an OpenGL window of at least 640x480. You will provide mouse input controls to allow the user to control the object with arcball controls as discussed in class. Your program will also allow for at least 4 lights placed at different points in space around the model that will affect it and that you can toggle on and off by pressing the number keys on the keyboard.

Input/Output Specification

Your program is expected to provide at least the obj file name from the command line...

eg.

assignment1 -m MyModel.obj

Model Loading and Rendering

With the provided obj file name, your program should find the file and load it using the LoadObj code provided. The obj file should include vertex: positions, colours, texture coordinates and normals.

Arcball

The arcball controls allow the user to manipulate the model to allow the viewer to inspect the model from different points (relative to the model) and with varying lighting conditions.

Grading rubric

The grading for this assignment is as follows:
5% - Your program compiles without errors or warnings. 
5% - Your program brings up an OpenGL window with the specified characteristics.
55% - Rendering the obj file.
	5% - Your program finds and loads the obj file using the provided code.
	20% - Your program renders a flat-shaded model from the obj file.
	5% - Your program finds and loads the texture to apply to the obj file with the provided bmp file loading code.
	10% - Your program renders the model with the texture applied and looking correct.
	10% - Your program defines and renders at least 4 lights, renders the model lit and allows for user input to change the lights that are active.
	5% - Your program performs reasonably interactively with the textured and lit model.
45% - Arcball controls.
	10% - Your program responds to mouse inputs as specified.
	30% - Your camera updates as specified by the arcball controls requirements.
	5% - The behaviour of the arcball controls is correct and performs reasonably interactively.
All necessary code and data must be tar and zipped into a file with your full name or student number. eg. FirstLast.tar.gz or 123456789.tar.gz

Code Files

LoadObj.cpp
LoadObj.h
bitmap.h
makefile

Note: There was found a serious problem with the LoadObj files; they will load obj files correctly but can't be used for indexed rendering. Alternative LoadObj files are given that take raw float buffers instead of vector buffers and can be used with indexed rendering. Either version is acceptable.

LoadObjNew.cpp
LoadObjNew.h