Tutorial for texture mapping a map onto an Open GL ES sphere?
I'm not looking for a library or even open source code. I want to learn how to do this on my own.
Where do I start to find an online tutorial, a book chapter, or ot开发者_StackOverflow社区her educational material for generating a polygonal model of a 3D sphere suitable for feeding to Open GL ES on an iPhone, and then mapping the polygons to some sort of 2D map data so I can texture map the sphere? Is there some sort of software tool (blender? maya?) with a tutorial on how to do generate this data? Where is the best place to start?
How about these articles?
- Procedural Spheres in OpenGL ES
- OpenGL ES From the Ground Up, Part 6: Textures and Texture Mapping
I've heard good stuff about "iPhone 3D Programming". Jeff LaMarche also recommends it here.
Hope this helps!
While not OpenGL ES, I once tried porting across the examples from this chapter in the Red Book where they show how to create an icosahedron and subdivide it to produce smooth spheres. I only got as far as using a simple icosahedron to crudely represent a sphere in the code for my Molecules application. Perhaps you could extend that.
Apple has a Mac sample application, GLSLShowpiece, that textures a sphere in a couple of places, but they use gluSphere()
to generate the sphere vertices, which is unavailable in OpenGL ES.
To be honest, I'm in the process of replacing the sphere rendering code in Molecules with a 2-D billboarding approach that uses shaders to generate the sphere coloring. This should allow for far smoother spheres without having to resort to massive amounts of geometry. See this paper for the kind of results you can produce this way.
精彩评论