THIS IS A DESCRIPTION OF THE PARAMETERS TO THE ROUTINE SHADE. ------------------------------------------------------------ illum_parm_td illum; the illumination parameter structure for the current object lght_parm_td *light; The light parameter structure light[i] is for object i viewport_td view_p; The viewport structure (vb,vt,vr,vl) tran_mat_td inv_view The inverse of the viewing transformation (takes you back to world space tran_mat_td inv_tm; The inverse of all the transformations - takes you back to object space. double z, y_coord The z and y coordinates of this pixel in perspectedd image space (-1.0 to 1.0) long x; The x location of the pixel in screen space. int l_interp Interpolate light vectors per pixel ? int numlights the number of lights for the scene int face The face number of the polygon covering this pixel that is being processed c_t_illum_td cooke; Cooke-Torrence illumination structure. txt_u_td *u_map; txt_v_td *v_map; Some texture inverse mapping values - NOT USED for 782 xyz_td **face_ptr2 A structure containing the points in object space face_ptr[face][0,1,2,3] are the points you will need for texturing. xyz_td norm_p The normal in world space - used for illumination calculation xyzw_td **wld_sp; The structure containig the points in world space - used for environmental mapping and "bump" mapping. rgb_td color_buffer The color value currently in the color buffer for this pixel - used for transparency calculations. THIS IS A DESCRIPTION OF THE LOCAL VARIABLES OF THE ROUTINE SHADE. ------------------------------------------------------------------ double xt; A temporary variable used for getting the x location of the pixel in perspected image space. xyz_td pnt_img, The location of the point in image space. xyz_td pnt_obj, The location of the current pixel in object space. xyz_td pert_norm, The normal in world space used for illum. calcs xyz_td reflect; A reflection vector for env. mapping xyzw_td pnt_objw; Temp variable used to get the point in object space. rgb_td final_color, diffuse, specular, temp, env_spec; Color values used in calculating the color of the pixel. Note: When doing color texturing, you can put the value from the color texture map in illum.color[face], since nothing is stored in this when the object is color textured. David -----