Hi.
I am creating some planets. I am using some images of our dear planet as textures, and using gluSphere to render the planet. However, the result is a “reversed” earth. Not vertically, so that the north pole is the south pole and vice versa. Rather, it’s flipped horisontally, so that the earth appears “backwards” for lack of a better word. Now, my other textures (stars & background, - simple textured quads) work as they should. It is only a problem (at least so far), when using gluSphere.
I am not doing anything really special, so I am hoping someone has witnessed this before, and know what I am doing wrong?
gl.glPushMatrix();
gl.glTranslatef(xpos, ypos, -1);
// get a nice orbital angle.
gl.glRotatef(45.0f, 0.0f, 1.0f, 0.0f);
gl.glRotatef(20.0f, 1.0f, 0.0f, 0.0f);
// set orbit radius
gl.glTranslatef(orbitRadius, 0.0f, 0.0f);
// textures don't map properly for planets.
// Rotate a bit so the planets appear correct.
gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
gl.glRotated(-rotationAngle, 0.0f, 0.0f, 1.0f);
// bind the texture.
planetTextures.get(textureRef).bind();
glu.gluSphere(gluq, planetRadius, planetDetailLevel, planetDetailLevel);
gl.glPopMatrix();
rotationAngle += rotationSpeed;