PDA

View Full Version : Generating texture coordinates evenly



rhmazza
11-03-2000, 11:47 AM
I'm trying to have OpenGL generate my s and t texture coordinates for me, but I'm having trouble getting it to look right on certain objects, mostly solid cylinders.

I can't figure out good s and t vectors to use so that the texture is just mapped evenly around the whole object. There always seems to be some streaking on a pair of sides or something.

My main problem is that I just haven't found a good reference for how the s and t coordinates actually work, but if anyone can help me out with the s and t vectors I'm looking for that would map evenly on all parts of an object, that would be great.

Thanks GLers,
Ray

mcraighead
11-03-2000, 12:12 PM
This is a common problem when you try to draw an entire object with just one set of texture coordinates.

If you're trying to wrap some kind of image around an object, you will generally need to duplicate some vertices and give them different texture coordinates.

Generally, texgen is better suited for algorithmic kinds of texture mapping than for mapping images on arbitrary objects. For example, texgen is great for projecting spotlight textures.

- Matt

vic
11-03-2000, 08:22 PM
can anyone tell me a simple explanation of what is texture S & T, Q, R and what can be used with or to do what?

i know its used under env mapping, sphere mapping and all that in opengl, but how does it work for us?