Sample Programs using Lighting Models

Larry Grose grose at camax01.UUCP
Tue May 10 01:16:53 AEST 1988


A warning concerning SGI's implementation of their lighting model.  In
order to differentiate between when transformations are intended to modify
just the model and when they are intended to modify both the model and the
lights, they have added an mmode() call, which is described in section
14.4 of the Graphics Library User's Guide.  It claims that the calls
perspective, window, ortho, and ortho2 work under both MVIEWING and
MPROJECTION modes.

However, when I was out at their headquarters porting to the GT and
scratching my head over why my lighting model code no longer worked
(normals appeared to be reversed), I talked to one of their software
gurus, who helped implement the lighting model for the GT.  He pointed
out I wasn't using MPROJECTION mode with the above calls and I pointed him
to SGI's documentation.  He politely said 'ouch', and admitted that it was
wrong for the GT (ie, perspective, window, ortho, and ortho2 must be used
under MPROJECTION mode only).  Unfortunately, the buck apparently stopped
there, because the new documentation that came with 3.0 still has the same
error.  In the 4 examples provided in section 14.6 for using mmode, only
the first one will work on the GT (all 4 work for non-GT's).

To the best of my knowledge, the rest of the lighting model documentation
is correct, though admittedly it is not very tutorial in nature.



More information about the Comp.sys.sgi mailing list