CS430/536 - Homework Assignment 5

Programming Problem:


1. Implement z-buffering with near and far plane clipping. You will need to extend your XPM implementation to add RGB color, and be able to process up to three SMF models. They 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 "000000".
    3. In order to use only one-character codes for the colors in your XPM file, you can limit the number of colors to 20 shades of pure red, 20 shades of pure green and 20 shades of pure blue in your output image.
    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 "ff0000" (red). (bound-sprellpsd.smf)
    10. [-g] Followed by the name of the second SMF model. Its base color is "00ff00" (green). (no file)
    11. [-i] Followed by the name of the third SMF model. Its base color is "0000ff" (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.xpm

Here is the XPM image file.


    15. Input/Output Examples:
         i. Input: ./CG_hw5 -f bound-cow.smf -F 0.1 > hw5_b.xpm
        ii. Output:
Here is the XPM image file.


         i. Input: ./CG_hw5 -f bound-cow.smf -F 0.1 -B -0.18 > hw5_c.xpm
        ii. Output:
Here is the XPM image file.


         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.xpm
        ii. Output:
Here is the XPM image file.


         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.xpm
        ii. Output:
Here is the XPM image file.


         i. Input: ./CG_hw5 -j 334 -k 24 -o 449 -p 402 -f bound-sprellpsd.smf > hw5_f.xpm
        ii. Output:
Here is the XPM image file.


         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.xpm
        ii. Output:
Here is the XPM image file.


         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.xpm
        ii. Output:
Here is the XPM image file.


2. Grading Scheme

  1. viewport mapping correct : 1 point
  2. 3D viewing : 1 points
  3. near/far plane "clipping" correct : 1 points
  4. Z-buffer correct : 4 points
  5. depth-cueing correct : 2 points
  6. reading multiple files : 1 point

3. Submission Guidelines:

  1. Assignments must be submitted via Bb Learn.
  2. 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.
  3. All source code. Your code must compile and run on tux (Linux).
  4. You may program in any language you like as long it can produce a usable executable on tux.
  5. 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.
  6. Makefile: have the default rule compile your program. Jar file, if using java.
  7. 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 XPM to standard out.
  8. Points will be deducted if submission guidelines are not followed.
  9. Further details about Bb Learn
    1. You can reach Bb Learn through DrexelOne.
    2. 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.
    3. Click on the assignment you wish to submit.
    4. Find your file and click Upload button.
    5. 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 December 29, 2014.