Different Rotations, Scalations, etc....

Started by
0 comments, last by Sebo 22 years, 3 months ago
Hi, Till now I''ve got all my knowledge from samples :-) I made a sample, with 3 Objects. I drew the Objects static on their places, without translation and scalation, etc.. Then I wanted to make 2 cylinders with the openGL Procedure for Cylinders and disks, etc. They should be on two different places. I tried to bring them on those two different places with glLoadIdentity(); and then the translation, scalation, etc. But it doesn''t work. I get some crazy..... So my question: How do i transform and rotate two different Objects, without rotating the others with the object?!
Advertisement
You call PushMatrix() before transforming your first object, then PopMatrix() after you''re done. And do the same with each object.

What that does is save a copy of the current transformation onto the matrix stack, let you do your local transform, then restore it to what it was.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement