rick@hanauma (Richard Ottolini) (04/10/89)
You don't need something as complicated as ray tracing to display a gridded surface. (1) Take the grid coordinates and multiply each by the 4x4 homogeneous matrix that does rotation, sizing, and perspective for the view you want. (2) Decompose the grid into rectangular or triangular patches. Compute the surface normal of the patch. Take the dot-product of the normal with the illumination source direction to get the brightness of the patch. (3) Fill in the pixels of each patch according to the color weighted by the brightness. Draw each patch in order from farest to nearest. [better results: do #2 and #3 for each vertex of the patch and do an interpolated pixel fill.] Each step is about a 50 line subroutine.