PDA

View Full Version : Texture Mapping



ToddAtWSU
05-21-2006, 07:23 PM
I am having problems understanding how texture mapping works? I have a 2-D screen and am taking a pgm file and creating it into a 3-D scene. I want to add a texture map of the pgm file to my 3-D scene, but I am having problems understanding how to do this. And I cannot find any good sources online to help me with this, so I thought maybe someone would know of a good example I could look at for this. I have the red book and superbible, but I don't quite follow these since most of the examples seem to use a bmp file. Thanks for your help!

dorbie
05-21-2006, 10:45 PM
You create a texture, select a texture environment mode, enable texturing and supply texture coordinates for each vertex.

If you consider your texture image as a rubber sheet then the numbers 0.0 - 1.0 in x and y plot points on the image. The image is stretched between vertices of triangles using the locations you supply for each vertex.