Matrix stacks

Any one want to share your opinion about the use of the matrix stacks. As far as my app is concerned, all of stacks only have one element at any given time, but the stack size for the modelview matrix is acturally 32, why?

That’s how a stack works. You can only see the top element of the stack at any given time (or, in the case of GL, the concatonated matrices of all those below them). Does it really matter for you to be able to access the stack 3 matrices down from your current position? In general, when you use a matrix stack, you don’t really care about what is below the top matrix.

No. I don’t need to access 3 elements below the top of the stack.

My qestion was, what do we need the matrix stack for? Designer of OpenGl sure didn’t created those three different types of stacks for no purpose.

Originally posted by MaxFive:
My qestion was, what do we need the matrix stack for?

The stack is an excellent data structure for un-/doing things in a hierarchical fashion. Consider rotating/moving parts of a human body,Body->Leg->Knee->Foot->Toe->Nail…

Originally posted by roffe:
The stack is an excellent data structure for un-/doing things in a hierarchical fashion. Consider rotating/moving parts of a human body,Body->Leg->Knee->Foot->Toe->Nail…

Thnx. I have been keeping track of the matrix in my app.