| | |
OpenGL
Please support our Game Development advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2006
Posts: 327
Reputation:
Solved Threads: 22
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?
"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.
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.
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.
![]() |
Similar Threads
- Using OpenGL in Visual C++: Part I (Game Development)
- I need a solution for a opengl thing (C++)
- Randomize number with OpenGL (C++)
- Need advice using openGl with win XP (C++)
- OpenGl project and windows XP (Game Development)
Other Threads in the Game Development Forum
- Previous Thread: What is OpenGL
- Next Thread: OpenGL and Glut
| Thread Tools | Search this Thread |
3d advertising ai algorithm ban c++ cambridge camera censorship china competition console development engine fov fpx game gamer games gaming gauntanamo government graphics idaho in-gameadvertisement intel intellectualproperty l-systems laracroft larrabee lindenmayer live manhunt math mathematics matrix mercenaries microsoft mmorpg modded msn multicore naked news nintendo obama opengl palin physics pirate playstation politics processor projection ps3 rpg search selection software sony stephenhawking stocks studio technology terrorism tombraider uk videogame web wii world-of-warcraft xbox xbox-live xbox360






