943,832 Members | Top Members by Rank

Ad:
May 12th, 2007
0

OpenGL

Expand Post »
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?
Last edited by Colin Mac; May 12th, 2007 at 7:15 pm.
Similar Threads
Reputation Points: 78
Solved Threads: 22
Posting Whiz
Colin Mac is offline Offline
327 posts
since Sep 2006
May 13th, 2007
0

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.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
May 13th, 2007
0

Re: OpenGL

Thanks.
Reputation Points: 78
Solved Threads: 22
Posting Whiz
Colin Mac is offline Offline
327 posts
since Sep 2006
May 18th, 2007
0

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...
Reputation Points: 27
Solved Threads: 3
Light Poster
Grigor is offline Offline
26 posts
since Jan 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Game Development Forum Timeline: What is OpenGL
Next Thread in Game Development Forum Timeline: OpenGL and Glut





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC