Advertisement Jump to content
Sign in to follow this  

Texturing a sphere

This topic is 3518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, is it possible to change the texture coordinates for gluSphere? I have some textures that I would like to tile the sphere with but no matter what I do it just covers the sphere a single time. Since my sphere is pretty large the texture looks extremely pixillated. I know I could probably manually tile the texture in photoshop or something but I would really like to do it in code so I have the greatest flexibility. Thanks for any help!

Share this post

Link to post
Share on other sites
AFAIK, there is no way to affect the texture coordinate generation of the glu primitives. However, there are three simple methods to achieve what you want:

a) Code a replacement for gluSphere.
-It should take less than 30 lines of code, and you can then do whatever you like with it.

b) Manipulate the texture matrix.
- Set the matrix mode to GL_TEXTURE_MATRIX, and then apply a scale with glScale().

c) Use a shader.
-You can modify the texture lookup however you like inside the shader.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!