glRotatef(rotation-rate,x,y,z);
glBegin(GL_TRIANGLES);
glrotatef(rotation-rate,x,y,z);
glBegin(GL_TRIANGLES);
//object no. 1
glEnd();
glrotatef(rotation-rate,x,y,z);
glBegin(GL_TRIANGLES);
//object no. 2
glEnd();
glEnd();
Okay, I know this code probably won''t work (cause of GL_TRIANGLES), but it''s just for the idea. Making 2 objects, rotate each of them separately, and then rotate both of the objects as if they where one object. Are such things possible?
Thanks!
Scope in OpenGL?
Hi there,
Never tried, but just wondering : can I use scope in OpenGL? Like :
You can kind of do what you want (if I understand) like this:
[Resist Windows XP''s Invasive Production Activation Technology!]
glRotatef(FirstVal,x,y,z);glPushMatrix(); glRotatef(SecondVal,x,y,z); glBegin(GL_TRIANGLES); // ... glEnd();glPopMatrix();glPushMatrix(); glRotatef(ThirdVal,x,y,z); glBegin(GL_TRIANGLES); // ... glEnd();glPopMatrix();
[Resist Windows XP''s Invasive Production Activation Technology!]
No, because you can only use a subset of OpenGL commands between glBegin and glEnd. You can have OpenGL "remember" previous states (though not for the drawing mode as in your example), using the glPush* and glPop* commands. This is particularly useful for matrices.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement