PDA

View Full Version : volume texture and GL_OBJECT_PLANE



GameMaker
10-20-2002, 12:22 PM
I am using a 3D texture volume for the data and GL_OBJECT_PLANE for automatic texture mapping onto a cube. Everything works fine when it is at the origin, but as soon as I translate the model, the texture doesn't map correctly anymore. Do I need to adjust my planes whenever I translate the model? Do I need to translate the TEXTURE matrix?

float xPlane[] = {1.0f, 0.0f, 0.0f, 0.0f};
float yPlane[] = {0.0f, -1.0f, 0.0f, 0.0f};
float zPlane[] = {0.0f, 0.0f, 1.0f, 0.0f};

glTexGenfv(GL_S,GL_OBJECT_PLANE,xPlane);
glTexGenfv(GL_T,GL_OBJECT_PLANE,yPlane);
glTexGenfv(GL_R,GL_OBJECT_PLANE,zPlane);