Jump to content
  • Advertisement
Sign in to follow this  
pjyelton

Texturing a sphere

This topic is 3421 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
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!