Original Post
How do I transform my objects around a fixed coordinate system rather than the object's local coordinate system?
glMatrixMode(GL_MODELVIEW);glLoadIdentity();glTranslatef(100.0F, 100.0F, 0.0F); //Move object to (100, 100, 0) in worldglRotatef(45.0F, 0.0F, 1.0F, 0.0F); //Rotate the object 45 degress around Y axisglScalef(10.0F, 10.0F, 10.0F); //Scale the object// Draw a sphere at the world originglPushMatrix();DrawSphere();glPopMatrix();// Draw a boxglPushMatrix();glRotatef(pitch, 1.0f, 0.0f, 0.0f); glRotatef(yaw, 0.0f, 1.0f, 0.0f); glTranslatef(0.0f, 0.0f, transZ);DrawCube();glPopMatrix();
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more