Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!sun-barr!decwrl!ucbvax!GATECH.EDU!ccsupos%prism From: ccsupos%prism@GATECH.EDU ("SCHREIBER, O. A.") Newsgroups: comp.sys.sgi Subject: Re: subroutines perpec and lookat Message-ID: <8907250331.AA20644@prism.gatech.edu> Date: 25 Jul 89 03:31:01 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 26 I cannot guess why your program does not work, I can only help clarify what perspective and lookat do. Perspective loads a matrix onto the matrix stack, destroying what was previously on top of the stack. Lookat multiplies a "lookat" matrix by the top of the stack and replaces the top of the stack with the result. Check the GL User's Guide to see the exact matrices that perspective and lookat generate. In general, you probably want to use perspective and lookat together, doing a perspective without a lookat or a lookat without a perspective is probably a bug. However, it is quite normal to load a perspective matrix, push it, and then apply a lookat. To apply a new lookat, do a popmatrix (gets back to the perspetive) do a pushmatrix (copies it on the stack) and then do another lookat. Hope this clears things up. To aid in debugging, write a routine to print a matrix out to the terminal, then call getmatrix and print the matrix out when things go awry. In reference to the above help message, I have straightened out my handling of the transformation matrices. However, the twist given to the projection does not always correspond to the one that is input. Has anyone ever had this problem? Thanks in advance. Olivier Schreiber