PDA

View Full Version : Rotating mapped sphere



12-10-2003, 01:33 PM
Hello! Why can't I rotate a simple mapped sphere? I load the bmp image, use bindtexture and rotate it, but the texture remains in the same place,why?
with all others objects it isn't a problem,but with the sphere it seems to have something wrong,please help me, thanks!

Deiussum
12-11-2003, 05:25 AM
How are you generating your texture coordinates? It sounds like maybe you are using the glTexGen features...

12-11-2003, 07:46 AM
Yes, I'm using glTexGen and GL_SPHERE_MAP,
the texture stays fixed, why?
Instead, with GL_OBJECT_LINEAR, it moves but the sphere is not textured correctly.

maximian
12-11-2003, 08:55 AM
Just generate your own texture coordinates when you generate the vertices defining your sphere. Google for texture coordinates for sphere and you will find the equation you need to use. Remember also, that textures are flat, and you need a special filter to generate a texture which will look okay on a sphere.

Sphere mapping is actually used to simulate simple environmental reflections, ie the object reflects the environment, which is defined by the map.