Homework 5
Short Description:
Develop a program which can display multiple mesh based objects. Your program should allow the user to navigate about the scene.
This assignment is worth 50 points.
Goals
When you finish this homework, you should have
- Developed an object capable of loading, manipulating and displaying a triangular mesh object.
- Developed a program which allows the programmer to move a camera about a scene
Formal Description
Write a program which will load models based upon the format described here. You should build a class that supports models stored in this format. Your class should support the following:
- Default constructor for loading the object.
- Copy constructor and overloaded assignment operator which returns a duplicate object pointing to the common vao(s).
- Translations of the object in space.
- Drawing the object.
If your class encounters a polygon object which is not a triangle, it should convert it to a set of triangles. IE a five sided object becomes three triangles, (p1, p2, p3, p4, p5 ) => (p1, p2, p3), (p1, p3, p4) => (p1, p4, p5)
Your class should not retain the model data after it has been stored in a buffer. . You may wish to retain model meta-information however.
I would maintain two (or possibly three) sets of transformation information per object. A move to default location transformation, a position transformation, and a move transformation.
Your program should display a number of objects, including two or more of a single object to demonstrate your ability to create multiple instances of your class.
Your program should support the following keypresses.
- q - quit, exit the program
- r - reset, reset all elements back to the default values.
- f - move the look at position forward by a fixed amount.
- b - move the look at position backward by a fixed amount.
- l - rotate the look at position to the left by a fixed amount.
- r - rotate the look at position to the right by a fixed amount.
- u - rotate the look at position up by a fixed amount.
- d - rotate the look at position down by a fixed amount.
- left arrow - translate the camera and look at position up by a fixed amount.
- right arrow - translate the camera and look at position down by a fixed amount.
- forward arrow- translate the camera and look at position forward by a fixed amount
- back arrow - translate the camera and the look at position backwards by a fixed amount.
You should work in whatever coordinate system you find comfortable. For this reason, no amounts are given, but you should provide reasonable defaults for moving about in your scene.
You should start in a reasonable position with several objects in view.
Discussion
- My intention is for this to be the beginnings of a "world", where multiple objects can be placed and the user can explore. I would build a mesh object which represents the ground and place several objects about on the ground.
- Feel free to use whatever models you wish, but you must provide me with the models so that I can test yous programs.
- Feel free to add additional "cool" features, be sure to document these in your README.
- Your program must use the vertex shader to perform the actual rotation.
- You may "cheat" on colors, and use a uniform variable to generate the colors in the shader. On the other hand, you may build a color buffer and create a rainbow effect, perhaps based upon the age of the vertex. Or even both!
Required Files
Your code, a Makefile, and a README file.
Submission
You should email tar file as an attachment to a message to danbennett360@gmail.com.