CMP 161 -- Programming Assignment 0
Due date:
10:00am THU, 1/12/06
Objectives:
Warmup program. Review basic camera setup,
object transformation, lighting and shading.
Also learn to use FLTK for the graphical user
interface to your program.
Implement the following in stages of increasing complexity:
-
Read and render the woman coor/poly file in:
http://www.soe.ucsc.edu/~pang/161/w06/data
.
Make sure the woman is scaled and centered at the origin so
that it is facing the user and occupies roughly half of the
viewport space.
Allow the user to
switch among the three shading modes:
(a) wireframe, (b) flat or constant shading, and (c) smooth or gouraud shading
[about 20% of functionality]
-
Add functionality to
(a) translate, (b) scale, and (c) rotate the woman.
The amount of transformation can be specified using
fltk sliders or directly on the screen by dragging the mouse.
You can use other gui aside from fltk if that's what you prefer
[about 40% of functionality]
-
Allow the user to manipulate the camera (ie. viewpoint) around the object.
Note that this is different from applying the transformation to the object
[about 20% of functionality]
-
Add a light source that the user can interactively
drag and move around the scene
[about 20% of functionality]
Resource:
-
Check out the
Links to on-line help
from the class web page.
Click on
Sample programs
under FLTK.
Note, only the last 2 links are active.
-
A startup program is also available
here . Code for reading data files are also in here.
Pitfalls:
-
A common problem is that your object may appear to be ``checkered''
or have holes. This is usually due to inconsistency in how the vertices
are defined. Ideally, they should all be consistently specified in a
counter-clockwise fashion. Unfortunately, not all data files follow this
convention. One way to deal with this is by turning on two-sided lighting.
-
Another common problem is incorrect shading of surfaces.
Make sure you assign some neutral (grayish) ambient lighting
so you have something to see.
If some parts of the object does not appear to be lighted properly,
it could be because your surface normal calculation is incorrect.
(see problem above also).
Grading:
This program accounts for 6% of your total grade.
We must be able to compile/test your code.
Therefore,
code and accompanying make/project files, etc.
must be tested for successful compilation at least
for the machines in Kresge 317.
Be sure to include a README in your submission
as to which platform to use.
Submission:
Submission must be done using the "submit" command from CATS.
- To submit use: submit cmps161-ap.w06 prog0 files
- To verify submission use: peek cmps161-ap.w06 prog0
These commands should work from any cats machine, but if there is a
problem try it from unix.ic. Create and submit a subdirectory called "prog0".
It should
contain all the files you have to make your program compile/run.
DO NOT include the data file in your submission -- or we will run out
of disk space in the submit directory.
Approximately 20% of the grade is towards
documentation/readability/style/ease of use.
Last modified
Tuesday, 22-Jan-2019 09:42:15 PST.