Please support our Game Development advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2006
Posts: 327
Reputation: Colin Mac is on a distinguished road 
Solved Threads: 22
Colin Mac Colin Mac is offline Offline
Posting Whiz

OpenGL

 
0
  #1
May 12th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,626
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 468
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: OpenGL

 
0
  #2
May 13th, 2007
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.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 327
Reputation: Colin Mac is on a distinguished road 
Solved Threads: 22
Colin Mac Colin Mac is offline Offline
Posting Whiz

Re: OpenGL

 
0
  #3
May 13th, 2007
Thanks.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 25
Reputation: Grigor is an unknown quantity at this point 
Solved Threads: 3
Grigor's Avatar
Grigor Grigor is offline Offline
Light Poster

Re: OpenGL

 
0
  #4
May 18th, 2007
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...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Game Development Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC