Jump to content
  • Advertisement
Sign in to follow this  
Ahl

Applying textures to icospheres?

This topic is 3791 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

Subject says its all. Now that i've gotten my lighting to work properly on my spheres how do I apply textures? Thx in advance.

Share this post


Link to post
Share on other sites
Advertisement
Not sure what you are asking:

1. How do I texture an object in GL?
2. How do I assign texture coordinates?

if your question is 2, then your going to do that in a modelling application.

Share this post


Link to post
Share on other sites
So option 2 then or do what V-Man said.

You can either have a cubemap (which would have to be made without seems). Or do option 2. You can unrwap sphere models in modelling packages (not sure how well icospheres work), and then you don't have to do anything other than bind the texture.

Blender for instance has Unwrap->Sphere and Unwrap->Cylinder etc. Every application should have something like this. Like I said I dont know how well it works on an icosphere, but it should.

Share this post


Link to post
Share on other sites
You can do it in a shader simply by calling one or two functions. If you don't know shaders, then you need to just change some things of which I dont remember.

http://developer.nvidia.com/object/cube_map_ogl_tutorial.html

or just buy a book on openGL.

Share this post


Link to post
Share on other sites
Alright so I broke out my old OGL book and found the code necessary. It gives a pretty good explanation of what it does and I think I have a good grasp on it. What it doesn't give is how to implement the code.

Do I call all the glTexImage2D calls before I call my sphere? After?

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
It doesn't sound like a good book if it doesn't show an example. You need to create the texture, then you can use it. You didn't find anything on the internet or developer.nvidia.com?

Share this post


Link to post
Share on other sites
They give the example code, loading the imagine, converting to texture, etc., they just don't show where to use the code. How to apply it. Hence my question.

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!