Normally in openGL you have x/y axis as right/left and up/down, the z axis is you depth with -z moving into the monitor and z moving out from the monitor.

If you want to switch this to something like x/z with y requires you to rotate everything 90 degrees.

Let’s look at your sphere at 0,0,5, since the camera is at 0,0,0. The sphere is now located behind us, 5 units and can not be seen.

Note also we must have a X/Y projection set correctly to see the object also. For this the X/Y must be greater then 5/-5 x and 5/-5 y, for the sphere to be seen when rotated. also if your sphere is greater the 1 unit in diameter, you will need a z-depth greater then 1/-1 to view it correctly.

// Rotate everything on the y 90 degrees

glRotate(90, 0, 1, 0);

or

glLookAt(0,1,0,0,0,0,0,1,0) // set’s the view to

look at the x/z view.

glPushMatrix();

glTranslatef( 0.0, 0.0, 5.0);

Draw_sphere();

glPopMatrix();

Just remember that openGL works with transformations in reverse.

Here is what happens when we draw the sphere:

- it is translated out 5 units on the z-axis.
- it is rotated 90 degrees around the 0,0,0 origin on the Y axis.

This puts the sphere 5 units out on what was the Y axis. Note to openGL x,y,z axis have not change, only our world’s x,y,z in relationship to openGL has changed.

Originally posted by not_yet:

[b]thanks everyone

interesting reading

just to see if I’m on the right track let me run this by you

if I’m looking straight down the ‘y’ axis, ie: the ‘y’ axis is coming out of the screen

what I see are the ‘z’ and ‘x’ axis

the camera is located at the default 0,0,0 pointed in the neative ‘z’ direction

now I create a sphere at 0,0,5

to help me visualize whats going on, is it fair to say that to see the sphere the camera and grid system ie: ‘x’ and ‘z’ axis are “moved” as a unit such that I can see the sphere

so the camera never leaves 0,0,0 but the x/z axis to which the camera is “attached” is floated in such a way that the object can be seen

thanks [/b]