PDA

View Full Version : Switching Z/Y planes?



bmcclint
09-10-2001, 07:42 AM
I have many stock models created with the X/Y plane as the ground plane and the Z axis used as an altitude coordinate. Can OpenGL be switched to use the Y axis as the depth and Z axis as vertical? Currently I am rotating the model initially on the X to get it orientated correctly before moving the camera.

cyclone
09-10-2001, 08:35 AM
Perhaps something such as this ?

glPushMatrix();
glRotatef(90.0, 1.0, 0.0, 0.0);
DrawYourObjectHere();
glPopMatrix();

or

glRotatef(90.0, 1.0, 0.0, 0.0);
DrawYourObjectHere();
glRotatef(-90.0, 1.0, 0.0, 0.0);


@+
Cyclone

DFrey
09-10-2001, 10:44 AM
If all your models need rotating, just rotate the modelview once before rendering the models, and then push and pop that matrix as needed. I would generally avoid cyclone's accumulating method above (the second method shown) unless you were reseting the modelview matrix before each frame, or possibly before each model depending upon the number of models.

john
09-10-2001, 04:30 PM
Hello,

something also worth considering is whether the geometry is left-handed.

cheers,
John

DFrey
09-10-2001, 04:50 PM
Good point. If you are using a right handed coordinate system, and the models are made in a left handed system, or vice versa, you will also need to mirror your models.