Banner
****************************************************************
Michael Chungkun Chen
Project Source
Lab 4

Please read the whole readme file before grading, especially the
notes at the end. - Thank you
****************************************************************

To run this program, after unTARing it, run make.  The included
Makefile should automatically compile the required object and
executable files.

After compiling, run the program by typing

lab4 < lab4*.in

The * signifies the input script you wish to run.
****************************************************************
The following are the modified commands available for the script

light <n> <intensity> <x> <y> <z>
ambient <ambient k * i value>
background <r> <g> <b>
display
object <filename> <r> <g> <b> <kd> <ks> <n>
backface        //toggles backface on

The following commands are from the previous lab and remains
unchanged in this lab.

scale
rotate
translate
reset
observer
nobackfaces	//toggles backface off
# 

****************************************************************
Backfaces is eliminated through backface culling by default, you
can disable this by inserting the command "backface" in your
input script.

observer default to 0 0 5 0 0 0 0 0.1 1000 30
background default to black (0,0,0)
ambient default to 0.25
light 1 default to (0,10,10) 0.8

****************************************************************
Notes!!!
I have implemented an incremental z buffer hidden surface
removal algorithm which is much faster than the normal one, and
this may also account for the differences between my results and
the sample (note the sample may not always contain the best
solution)  Since I use doubles throughout my whole program,
there should not be any rounding off error except during
rasterization.

My program offers support for 10 lights, lights number 0 to 9.
Although lights 1-5 may be used without worrying about the other
lights.

I also reduce memory usage by only allocating enough zbuffer for
one scan-line at a time.

Another note, I averaged all the verticies in the polygon for
the point which I picked to calculate the color intensity on.

Although the det files are supported from lab3, for some reason
it did not work right in lab4, so I have rescinded my claim for
det file support.  And since we are only required to support one
type, I'll support the ASC type.  One note for this note, the
det files are supported for windows.  So if you are bored and
feel like compiling it on a windows system, you can see the det
files in action.

Oh one note, I have gotten segmentation faults when the file
ends immedeately after the data.  I have formatted the data
included with this TAR so it would not cause these problems.
lab4A.in lab4B.in lab4C.in and lab4D.in are all running fine in
unix.  Since this project isn't about reading files, I don't
think points should be taken off.  Because the example scripts
will run.

****************************************************************
Credits
First part of the Lab 4 psuedo code was used as the base for the
display function.  Written by Professor Law, found on the class
webpage.

All lab3, lab2, and lab1 credits still hold true.

I hashed out the incremental z-buffer hidden surface removal
from the single polygon fill algorithm from lab2 and the
descriptions of the z-buffer algorithm from class and the psuedo
code.

Home | About Me | Text Depository | Future Enhancements | Guest Book | Links

Copyright © 1998-2008 Michael Chungkun Chen
All Rights Reserved.