matrix stack

  • Follow


Hello all,

I'm trying to do something quite simple in an attempt to understand
the matrix stack better. I have a square inside a square and they are
both rotating. I want to make the inner square rotate faster so I call
glPushMatrix before its drawn apply a further rotation, draw the
square and then glPopMatrix. However all this does is affect the
angular position relative to the outer square which means that when
something has been pushed and popped, its lost. I'd like to know if
there's any way to work around this and also whether there are
function to create transformation matrices in variables to apply
myself when I want.
Thank you.

Kostas
0
Reply skatoulas 12/3/2003 2:41:01 AM

Kostas wrote:
> when something has been pushed and popped, its lost.

Correct.

> I'd like to know if
> there's any way to work around this

No, that's what push&pop is supposed to do.

Try incrementing the angle you pass to glRotate() at each pass.


-- 
<\___/>          For email, remove my socks.
/ O O \
\_____/  FTB.    Why isn't there mouse-flavored cat food?


0
Reply fungus 12/3/2003 7:58:40 AM


1 Replies
109 Views

(page loaded in 0.052 seconds)

Similiar Articles:













7/16/2012 12:00:34 AM


Reply: