PDA

View Full Version : is there a reason why glLoadIdentity() doesn't work for me?



12-02-2001, 10:01 PM
hi all!

i'm having a problem w/glLoadIdentity...

i use it to clear the projection matrix, then set the PM. then i use it after setting opengl to modelview...

any time thereafter, if i call it, my geometry doesn't show up...

i wish i had code in front of me, but i'm on someone else's computer.

any suggestions?

Bob
12-02-2001, 11:46 PM
My suggestion is that you post the code when you have it. A very vauge description of the porblem.

jmg
12-03-2001, 08:33 AM
Your call to glLoadIdentity() is probably working fine (how could it not?) -- rather, it's likely that you're just aiming the camera off in the wrong direction or somesuch.

rixed
12-05-2001, 03:25 AM
You use it to clear the projection matrix ?

If it's true, you are wrong, use glPopMatrix instead. (did you feed up the modelview stack ? It could be a problem to show things...)

If you mean to clear to top matrix, forget my post :-)

DaytonGL
12-06-2001, 01:50 PM
I'm w/ jmg. You're probably aiming in the wrong direction (or your objects aren't where you think they are.) Happens to me all the time.

Korval
12-06-2001, 10:08 PM
glPopMatrix is not necessary for simply setting up a projection matrix. In fact, I wouldn't suggest glPushing/Poping off of the GL_PROJECTION matrix stack unless it is actually necessary to save the current projection matrix.

But, the sequence of code for re-setting the projection matrix is as follows:




glMatrixMode(GL_PROJECTION);
glLoadIdentity();
/*Insert your favorite perspective function. For example, gluPerspective(parameters);*/
glMatrixMode(GL_MODELVIEW);


And there you are.