Texture Coordinates

Hello,

i got some questions to texture coordinates :

1.) i read in the red-book how i could approximate a geosphere based on an icosahedron by subdividing. Does somebody know how i can calculate texture coordinates for the geosphere ?

2.) also i read that it is possible to generate texture coordinates automatically by opengl. But my books don’t cover this topic in detail. Maybe someone can tell me how it works or where to find informations about this.

3.) i am writing a cad-engine. Now i have to implement texture-support. For now every object can have at the most one texture. But at a later time, multi-texture-support has to be added. When an object has a list of textures, would it be better to store the texture-coordinates in the object, so that every texture in the list has the same texture-coordinates or would it be better to store the texture-coordinates in the texture-objects, so that every texture for the object has its own texture-coordinates?

Best regards

tabor25

texture mapping a sphere is difficult (+ impossible to do 100% accurate ie even distribution of the texture over the sphere)
see here anyways for a couple of idea http://astronomy.swin.edu.au/~pbourke/texture/

2/ depends on what u want, for 99% things ppl,house etc u will have to assign the texture coordinates yourself, automatic texturecoordinates cant do it for u btw theres info on automatic texture ccordinate generation in the red book

Texturing a sphere is not too difficult. YOu can turn on texgen and use sphere mode. THe problem with putting a square texture on a sphere is that there is a seam in the back and severe warping at the poles. 3d Studio Max actually found a nice way around this in version 3. They added another tex gen mode called shrinkwrap (or something like that). Instead of causing a seam between the 2 poles it wraps everything to a point. Imagine wrapping aluminum foil around a ball and pinching it all to one point, versus folding it over the ball and making a seam.

For these reasons alone spheres are generally not mapped as spheres but as a planar map (possibly from both sides) or with a cube map. Those are really the only ways to get around the problem of artifacts.

Devulon