If you will be developing in C, type:
/usr/class/cs248/assignments/assignment4/setup_c
If you will be developing in C++, type:
/usr/class/cs248/assignments/assignment4/setup_C
Please do not change any of the source files for the viewer. The submit script will not be submitting any of the viewer's source files, so we will not see any changes you make. The file shader.c contains stub functions that you should replace with your own functions, as described below.
./viewer [ -single | -double ] config-filewhere config-file is the name of a configuration file. Specifying -single uses single buffering, and -double uses double buffering. On the machines in Sweet Hall, use -single if you plan to save the image you render, since your rendering will not appear in 24-bit color in double buffering mode.
The configuration file specifies the layout of the scene, including which object to display, the location of the viewer and the light sources, and any parameters you wish to specify to your shading functions. We suggest that you make use of this facility - it is very handy to be able to change parameters of your shading function without recompiling. The file param.h contains descriptions of functions that you can use to retrieve parameters from these configuration files.
A list of pre-defined variable names that can appear in a configuration file.
Once the viewer has started, the mouse buttons do the following:
left button | Rotates the object |
middle button | Scales the object |
right button | Access the menu |
Your shading function has access to the information about the scene specified in info.h. The various information is documented in that file. Your shading function takes as a parameter a floating-point array of length 3, into which it should put the RGB color value it computes (minimum intensity is zero maximum intensity is one).
[email protected]