PDA

View Full Version : problem of 3d texture



hwj_just
05-21-2005, 10:02 PM
hello,i use two images to make 3d texture .the wide and height of image is 256*256 and one image is white,the other is blue. so the 3d texture is 256*256*2.when i do the texture mapping with alpha blend,what result is right?i can see the interval vertical stripes of white and blue

V-man
05-22-2005, 03:52 AM
Originally posted by hwj_just:
hello,i use two images to make 3d texture .the wide and height of image is 256*256 and one image is white,the other is blue. so the 3d texture is 256*256*2.when i do the texture mapping with alpha blend,what result is right?i can see the interval vertical stripes of white and blueFirst, no need to start a new thread.

The result that you get depends on the tex coords, but to produce vertical stripes of white and blue, you could create a quad like this

glBegin(QUADS)
glTexCoord(1.0, 0.0, 0.0)
glVertex(1.0, -1.0, 0.0)

glTexCoord(1.0, 0.0, 1.0)
glVertex(1.0, 1.0, 0.0)

glTexCoord(1.0, 1.0, 1.0)
glVertex(-1.0, 1.0, 0.0)

glTexCoord(1.0, 1.0, 0.0)
glVertex(-1.0, -1.0, 0.0)

glEnd

and make texture wrap mode REPEAT for r. s and t doesn't matter.

Read the Red Book or some online resource about texture mapping, as this is basic stuff.