GLUQuadric rotation

Hello everyone, I am experiencing a wierd issue. I created a Quadric Sphere and am simply trying to rotate it against two axes. Namely, the x and y axes. I simply perform two rotations using glRotatef and then call the GLU.gluSphere call (which by default places it in the origin). The thing is, after the first rotation the second one is messed up. I was able to figure out that after the first rotation, the second rotation’s reference axis was rotated in the first call! Very wierd. To make it clear this is what im doing…

gl.glRotatef(rX, 0.0f, 1.0f, 0.0f);
gl.glRotatef(rY, 1.0f, 0.0f, 0.0f); <-- the problem here is that if I rotated by 90, the x-axis is now at 0.0,0.0,1.0 when it should still be at 1.0,0.0,0.0

so in order to correct this, corrected for the rotation in the x axis by doing the following…

gl.glRotatef(rotY, ((float)Math.cos((-3.141/180)*rotX)*1.0f), 0.0f, -((float)Math.sin((-3.141/180)*rotX)*1.0f));

The wierd thing is that this works if I use it for glut.glutWireTeapot(100.0); but if I try to use if for

glu.gluSphere(sphere, radius, 32, 16);

the axes still dont move right…

Anyone else experience difficulties with GLUQuadrics?

~Bolt

Hi,

I may miss a thing here but since your sphere seems to be draw at the origin how can you tell that the axis are not “rotated”… rotated or not a sphere is always a sphere
You should translate a little in an axis direction don’t you?
And for the “weird” part of rotation it can’t be called weird since it’s in the specs…