Luagl question

Luagl question

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Luagl question

Post 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?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Luagl question

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Luagl question

Post 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
Post Reply

Return to “Lua Scripts”