DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Game Development (http://www.daniweb.com/forums/forum71.html)
-   -   OpenGL (http://www.daniweb.com/forums/thread78142.html)

Colin Mac May 12th, 2007 6:14 pm
OpenGL
 
I'm having a bit of trouble understanding what glLoadIdentity(); does in OpenGL . This is a quote from the Redbook.
"Recall that the viewing transformation is analogous to positioning and aiming a camera. In this code example, before the viewing transformation can be specified, the current matrix is set to the identity matrix with glLoadIdentity(). This step is necessary since most of the transformation commands multiply the current matrix by the specified matrix and then set the result to be the current matrix. If you don't clear the current matrix by loading it with the identity matrix, you continue to combine previous transformation matrices with the new one you supply"

I'm not sure what he means by the "new one you supply". Any help would be appreciated?

~s.o.s~ May 13th, 2007 1:14 pm
Re: OpenGL
 
When you perform any kind of transformations on the scene or on any object, its transformation matrix (the way with which it is displayed) is modified. When any transformations are performed, they are performed on the current matrix which is then modified depending on the operation to be performed.

Since for that particular code snippet, a clean matrix was required, it was necessary to reset the transformation to identity matrix. Hope it made sense, haven't been in touch with graphics for a long time.

Colin Mac May 13th, 2007 1:50 pm
Re: OpenGL
 
Thanks.

Grigor May 18th, 2007 1:00 am
Re: OpenGL
 
My mostly incorrect but simpler answer: "It clears the screen." Again that is probably not a good answer but a person new to 3D may find it useful...


All times are GMT -4. The time now is 12:55 am.

Forum system based on vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2010 DaniWeb® LLC