This assignment will ask you to fill in the code to allow rotation of the viewpoint around a scene.
Post any questions you have to the newsgroup. Other students will want to see the answers too. Do not post anything resembling code.
ONLY MAKE CHANGES TO Transform.cpp. Do not add any #include lines to the code. Do not change Transform.h. If you do make changes to any of the other files, make sure your solution works without those changes. You will only be submitting Transform.cpp.
The files nv_mathdecl.h, nv_algebra.cpp, nv_math.h and nv_algebra.h are provided as helper files. Don't worry about the details of these files. Concentrate on main.cpp. That said, You will probably have a much easier time if you look at set_rot().
You will be implementing a classic crystal ball interface. This simulates a world in which the viewer is glued to the outside of a transparent sphere, looking in. The sphere is centered at the origin, and that is the direction towards which your eye is always pointing. At the origin, there is something interesting to look at -- in this case, a teapot.
You can change the viewpoint by rotating the crystal ball in any direction about the origin. Usually this is done with a mouse, but you will be using the keyboard for this assignment to make things easier. You must think about how the position of the eye and direction of the up vector change with left-right or up-down rotations.Fill in the parts of Transform.cpp that say "//FILL IN YOUR CODE HERE". First, you should fill in left() and up(). Once these are working, fill in lookAt().
The compiled correct solution has been provided for you. Your solution must behave identically to hw1_solution.exe. All you need to test this is to press the arrow keys a few times and toggle 'g' to make sure your lookAt() works.
You should paly around with the solution to try and make the red and blue light line up by updating one and not the other (press 'h' when the solution is running). Also, you will have to answer a question in the submission email (see below).
When you are satisfied with you results, submit via email as described below:
Subject: HW1 - [your name]
Attachment: Tranform.cpp (do not include it as text. Make sure it's a seperate file attachment.)
Body: Your name and email.
Describe why it is that the red light seems to provide more than just a point light source, illuminating the entire half of the teapot, while the blue light leaves most of the teapot dark, only illuminating as a point source. The answer can be found in the red book (Woo), on page 189.
If you did not use Visual Studio on a Windows platform, please describe what you did to complete this assignment.