Page 1 of 1

Luagl question

Posted: 23 Jan 2010, 16:57
by smoth
glPushMatrix()
glTranslate(-mainWidth, -1, 0)
glColor(1, 1, 1, 1)
glTexture(IMAGE_DIRNAME .. "ResComIcon.png")
glTexRect(0, 0, 1, 1)
glTexture(false)
glPopMatrix()
Why the bold portions?

Re: Luagl question

Posted: 23 Jan 2010, 17:01
by lurker
It makes a temporary version of the current matrix for you to work on, so you can Rotate, Scale, Translate, etc. without altering things past your block of code.

Re: Luagl question

Posted: 27 Jan 2010, 01:06
by AF
think of it as a stack of matrices, and all your coordinates etc are multiplied by each one, by pushing a stack on the top you can do transformations etc, then 'undo' the stack by popping it, returning to the state you were before hand.

This way you don't need to do an extra set of operations in the opposite direction to return to the original rotation scale and displacement.

Keep in mind its a function of the fixed function pipeline