Sign in to follow this  

Texturing a sphere

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this