Now that i understand the modelview matrix, i must understand pop and push!
When you push and pop a matrix from the stack, what operations are done to make it happen?
I no it does 'things to the matrix stack, takes things off and on and stuff'...but how?
W8, i no..When are coordinates multiplied by the current modelview matrix?
Is it when they are created and/or when the current modelview matrix changes?
that would mean, some coordinates are multiplied several timesby the modelview matrix!
Am i correct?
glPushMatrix and glPopMatrix Intuition
You don't really need to understand pop and push, this is old and deprecated methodology. You would be much better served by forgetting these deprecated functions and learning correct shader techniques.
But if you're interested, pushing and popping don't actually 'do' anything to the matrix, its just a way to store the matrices to retrieve them later.
glPushMatrix = save this matrix for later
glPopMatrix = I'm done with my current matrix, retrieve the last matrix that I pushed.
But if you're interested, pushing and popping don't actually 'do' anything to the matrix, its just a way to store the matrices to retrieve them later.
glPushMatrix = save this matrix for later
glPopMatrix = I'm done with my current matrix, retrieve the last matrix that I pushed.
You don't really need to understand pop and push, this is old and deprecated methodology. You would be much better served by forgetting these deprecated functions and learning correct shader techniques.
But if you're interested, pushing and popping don't actually 'do' anything to the matrix, its just a way to store the matrices to retrieve them later.
glPushMatrix = save this matrix for later
glPopMatrix = I'm done with my current matrix, retrieve the last matrix that I pushed.
http://www.opengl.org/wiki/FAQ#glTranslate.2C_glRotate.2C_glScale
[color=#1C2837][size=2]
correct shader techniques. [/quote]
[color="#1C2837"][size=2]What do you mean? How does glPush and glPop effect the shader?
[color="#1C2837"][size=2]Does it not affect the coordinates? Or does it effect both?
[color="#1C2837"][size=2]
[color="#1C2837"][size=2]But if you're interested, pushing and popping don't actually 'do' anything to the matrix, its just a way to store the matrices to retrieve them later.[/quote]
[color="#1C2837"][size=2]I'm srry, i meant, what does it do to the coordinates?
Pushing and popping matrices does nothing to neither vertices nor shaders. It just saves and restores the matrices so you can manipulate them and then reverting any changes made at the time you popped them.
So, lets say you had a coordinate [1,2,3,1]
loadIdentityMatrix
glpushMatrix
then you scale the matrix x 2
Vertex3f(coordinate)
//now the coordinate is [1,2,3,1] , right?
glPopMatrix
//but now the coordinate is [2,4,6,1], right?
So, im asking is that, when you Pop the matrix does it force the coordinate to be multiplied by the popped matrix, then by the current matrix?
If not, how does it work?
Oh, and what are render functions?
loadIdentityMatrix
glpushMatrix
then you scale the matrix x 2
Vertex3f(coordinate)
//now the coordinate is [1,2,3,1] , right?
glPopMatrix
//but now the coordinate is [2,4,6,1], right?
So, im asking is that, when you Pop the matrix does it force the coordinate to be multiplied by the popped matrix, then by the current matrix?
If not, how does it work?
Oh, and what are render functions?
Why don't you just read the link that haegarr gave you, it actually explains this stuff.
http://fly.cc.fer.hr/~unreal/theredbook/chapter03.html
You obviously have a very poor understanding of how this all works, and while I don't mean that as anything negative towards you, you need to do some research on your own instead of just flooding the forum with 1000 questions.
http://fly.cc.fer.hr/~unreal/theredbook/chapter03.html
You obviously have a very poor understanding of how this all works, and while I don't mean that as anything negative towards you, you need to do some research on your own instead of just flooding the forum with 1000 questions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement