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 per color 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. Add the following options to your HW5 program:
    5. [-n] Followed by the floating point coordinate of the Front (Near) plane in VRC coordinates. (0.6)
    6. [-N] Followed by the floating point coordinate of the Back (Far) plane in VRC coordinates. (-0.6)
    7. [-1] | [-f] Followed by the name of the first SMF model. Its base color is "ff0000" (red). (bound-sprellpsd.smf)
    8. [-2] Followed by the name of the second SMF model. Its base color is "00ff00" (green). (no file)
    9. [-3] Followed by the name of the third SMF model. Its base color is "0000ff" (blue). (no file)
    10. smf files can be found here.
    11. The default values that should be assumed if none are entered are as follows: ./cs430_hw5 -1 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 -n 0.6 -N -0.6 > out.xpm

Here is the XPM image file.


    12. Input/Output Examples:
         i. Input: ./cs430_hw5 -1 bound-cow.smf -n 0.1 > hw5_b.xpm
        ii. Output:
Here is the XPM image file.


         i. Input: ./cs430_hw5 -1 bound-cow.smf -n 0.1 -N -0.18 > hw5_c.xpm
        ii. Output:
Here is the XPM image file.


         i. Input: ./cs430_hw5 -1 bound-bunny_1k.smf -2 bound-cow.smf -3 bound-sprtrd.smf -u -.8 -U .8 -v -.8 -V .8 > hw5_d.xpm
        ii. Output:
Here is the XPM image file.


         i. Input: ./cs430_hw5 -1 bound-bunny_1k.smf -2 bound-cow.smf -3 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.

2. Grading Scheme

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

3. Submission Guidelines:

  1. Assignments must be submitted via WebCT.
  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. Word documents will NOT be accepted.
  3. All source code. Your code must compile and run on tux (Linux). MacOS X is a negotiable possibility. The TA will use one of these as the test platform.
  4. You may program in any language you like as long it can produce a usable executable on tux. Please contact the TA if you plan on using something other than C, C++ or Java.
  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 (optional but appreciated): have the default rule compile your program.
  7. Points will be deducted if submission guidelines are not followed.
  8. Further details about WebCT
    1. You can reach WebCT 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 June 20, 2007.