CS430 - Homework Assignment 5
Programming Problem:
Implement z-buffering with near and far plane clipping. You will need
to extend your
PBM implementation to add RGB color (making your output PPM files), and be able to process up
to three SMF models.
The description of the PPM format can be found
here.
The models will be shaded using a linear depth-cueing algorithm.
Your output image will contain color-shaded models. No wireframe output is necessary.
1. All the command line options implemented in HW4
should be supported.
2. Set your image background color to black "00 00 00".
3. You can specify the number of shades per channel in PPM (256 might be fine).
The examples on this page were produced with
20 shades of pure red, 20 shades of pure green and 20 shades of pure blue
because of the limitations of XPM.
4. You can assume that your meshes will not
be clipped, and that you only need to render triangles.
5. Add the following options to your HW5 program:
6. [-F] Followed by the floating point coordinate of the Front (Near) plane in VRC coordinates. (0.6)
7. [-B] Followed by the floating point coordinate of the Back (Far) plane in VRC coordinates. (-0.6)
8. F and B can take on any value, but B should be less than F.
9. [-f] Followed by the name of the first SMF model.
Its base color is "Maxval 0 0" (red). (bound-sprellpsd.smf)
10. [-g] Followed by the name of the second SMF model. Its
base color is "0 Maxval 0" (green). (no file)
11. [-i] Followed by the name of the third SMF model. Its
base color is "0 0 Maxval " (blue). (no file)
12. Your program should be names CG_hw5.
13. smf files can be found
here.
14. The default values that should be assumed if none
are
entered are as follows: ./CG_hw5 -f bound-sprellpsd.smf -j 0 -k 0 -o 500
-p 500 -x 0.0 -y 0.0 -z 1.0 -X 0.0 -Y 0.0 -Z 0.0 -q 0.0 -r 0.0 -w -1.0
-Q
0.0 -R 1.0 -W 0.0 -u -0.7 -v -0.7 -U 0.7 -V 0.7 -F 0.6 -B -0.6 > out.ppm
15. Input/Output Examples:
i. Input:
./CG_hw5 -f bound-cow.smf -F 0.1 > hw5_b.ppm
ii. Output:
i. Input:
./CG_hw5 -f bound-cow.smf -F 0.1 -B -0.18 > hw5_c.ppm
ii. Output:
i. Input:
./CG_hw5 -f bound-bunny_1k.smf -g bound-cow.smf -i bound-sprtrd.smf -u -.8 -U .8
-v -.8 -V .8 > hw5_d.ppm
ii. Output:
i. Input:
./CG_hw5 -f bound-bunny_1k.smf -g bound-cow.smf -i bound-sprtrd.smf -q .4
-r .2 -w 1 -u -.6 -v -.6 -U .6 -V .6 -P > hw5_e.ppm
ii. Output:
i. Input:
./CG_hw5 -j 334 -k 24 -o 449 -p 402 -f bound-sprellpsd.smf > hw5_f.ppm
ii. Output:
i. Input:
./CG_hw5 -u -1.0 -U 0.8 -v -0.9 -V 1.0 -g bound-bunny_1k.smf -f bound-sprtrd.smf -j 34 -k 104 -o 149 -p 472 > hw5_g.ppm
ii. Output:
i. Input:
./CG_hw5 -u -1.0 -U 0.8 -v -0.9 -V 1.0 -g bound-bunny_1k.smf -f bound-sprtrd.smf -j 34 -k 104 -o 149 -p 472 -Q -1.1 -R 0.9 -W 0.6 > hw5_h.ppm
ii. Output:
2. Grading Scheme
- viewport mapping correct : 1 point
- 3D viewing : 1 points
- near/far plane "clipping" correct : 1 points
- Z-buffer correct : 4 points
- depth-cueing correct : 2 points
- reading multiple files : 1 point
3. Submission Guidelines:
- Assignments must be submitted via Bb Learn.
- README file: explain the features of
your program, language and OS used, compiler or interpreter used,
name of file containing main(), and how to compile/link your program.
Text files only. Word and PDF documents will NOT be accepted.
- All source code. Your code must compile and run
on tux (Linux).
- You may program in any language you like as long it can produce
a usable executable on tux.
- Your program will be run by the TA. Please do
NOT submit any image files, Visual C++ project files, or anything not requested
in this section. Your program must run on tux without the
installation of "special" libraries.
- Makefile: have the default rule compile your program.
- If you are using a language that doesn't produce an executable file,
e.g. python, then be sure to include a script called CG_hw5 that
accepts arguments and prints PPM to standard out.
- Points will be deducted if submission guidelines are not followed.
- Further details about Bb Learn
- You can reach Bb Learn through DrexelOne.
- Choose Computer Graphics among your list of courses. There is an "assignments" link in
the left frame which will give you the list of assignments in the right frame.
- Click on the assignment you wish to submit.
- Find your file and click Upload button.
- Hit Submit button. DO NOT FORGET TO HIT THE SUBMIT BUTTON AFTER YOU UPLOAD ALL YOUR FILES.
NOTE: Your source code for all programming assignments will be run
through a plagiarism detection system. This program uses compiler
techniques
which are invariant of syntax and style. If you are sharing code with
other
classmates, you will get caught. Please refer to the student
handbook for actions that will be taken.
Last modified on September 24, 2020.