CMPS 160 -- Programming Assignment 4 (viewing transformations)
Due date:
12 midnight, Friday, 6/7/13
Objectives:
Learn camera control and how it differs from object transformations.
Description:
Implement different camera functionality.
Requirements:
-
20% of functionality: (zooming)
Allow the camera to zoom in and zoom out in the scene using the mouse.
The camera zooms-in (translates along positive Z axis in viewing coordinate frame)
when the righ button is held down and mouse is moved forward.
Zoom out when righ button is held down and mouse is moved backward.
Make sure that the mouse is not over some object (other than the terrain)
when the button is pressed.
This is the same requirement as lab7.
-
40% of functionality: (panning)
Allow the camera to translate horizontally and vertically on the image plane
(XY-plane of the viewing coordinate frame).
The user achieves this with left button held down and mouse is moved left-right
(horizontal translation of camera) or moved up-down (vertical translation of camera).
Make sure that the mouse is not over some object (other than the terrain)
when the button is pressed.
-
20% of functionality: (look around)
Provide a GUI button labeled "look around".
When this button is pressed, the camera is rotated 360 degrees around
its current position. That is, rotate around the vertical axis (of the world)
by 360 degrees.
-
20% of functionality: (orbit around an object)
Here, the user is suppose to pick an object using a combination of key stroke and mouse click.
So, when letter "O" is pressed together with the left button,
the camera will orbit around the selected object.
Assume that the camera is currently at some location (Cx,Cy,Cz) in world coordinates.
The center of the selected object is at location (Ox,Oy,Oz) in world coordinates.
The camera will go around this object using the distance from its current location
as the radius. The path of the camera will trace out a circle on the z = Cz plane.
Points on this circle are the LookFrom points, while (Ox,Oy,Oz) is the LookAt point.
All objects can be orbitted except for the terrain.
-
Note that all the requirements from prog1-prog3 still applies.
Grading:
This program nominally accounts for 8% of your final grade. We must
be able to compile/test your code. Make sure that the code and accompanying
make/project files, etc. are tested for successful compilation at least on
the PCs in the lab.
Also be sure to include the statically linked executable and a README file
in your submission as to which platform to use.
Programs turned in at least a full day early will earn 1% bonus credit. Late
programs will be charged a 1% late point. In addition, late programs will not
be accepted 24 hours past due date.
The bonus credits may be accumulated up to a
total of 50% toward program and final project credits. Programs are graded 80%
for functionality and correctness and 20% for style, readability,
documentation/writeup, and efficiency. Additional points may also be earned
for extra features.
Submission:
Submission must be done using the "submit" command from CATS.
- submit cmps160-ap.s13 prog4 prog4.tar, or
- submit cmps160-ap.s13 prog4 prog4.zip
This command should work from unix.ic.ucsc.edu.
Create and submit a subdirectory called prog4.
It should contain a statically linked executable and
all the files you have to make your program compile/run.
Tar or zip up prog4 before submitting.
Last modified
Saturday, 18-May-2013 23:56:33 PDT.