View Full Version : glLoadIdentity
Is there any reason that the function glLoadIdentity() seems to be the kiss of death for the glBegin/glEnd drawing functions?
Whenever I evoke that function anywhere near where I have the glBegin/glEnd functions, I can't see what I have drawn.
Also, can you have a glBegin/glEnd that coexists with a glWire<shape> ? I've had no success with this either.
04-14-2001, 11:55 AM
you need to read up on howOpenGL utilizes matrices. glLoadIdentity() resets the current matrix, whether it be GL_MODELVIEW or GL_PROJECTION. when you render objects make sure your in GL_MODELVIEW state.
also in your render function dont call glLoadIdentity() then glPushMatrix()/glPopMatrix() that doesnt work.
i suggest reading http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/
this is the OpenGL Programming Guide, also known as the red book.
Good Luck http://www.opengl.org/discussion_boards/ubb/smile.gif
[This message has been edited by Warrior (edited 04-14-2001).]
04-17-2001, 04:16 AM
I've been programming in OpenGL for a couple of weeks now, and I've come across this
This is used in conjunction with 2 other functions called glMatrixMode(GL_PROJECTION) and glMatrixMode(GL_MODELVIEW). These functions are used to reset various matrices dealing with the viewing volume and any transformations of models drawn before and after the resizing of your window
//Establish clipping volume
I hope this example helps you.
04-17-2001, 04:33 AM
well..sometime the glLoadIdentity() might be what BobDole said (the kiss of death because it reset the current matrix.
so, in order to avoid the "kiss", the program should be arrange in a safe order,
some sort like use the glPushMatrix() and glPopMatrix() to avoid the previous matrix value gone "kapoomm!!".
try to read about the push and pop data structure usage.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.