I am working on a volume rendering problem using 3D texture and trying to using glTexGen
and TEXTURE matrix to generate the s, t, r texture cooridnate.
I understand how the TexGen works, but not sure how the texture matrix will effect the generation of the s,t,r.
For example, if the input vertex is(x, y, z, 1); after apply the the xPlane, the
s coordinate will be x.
How will the Texture matrix effect the s coordinates?
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};
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
// …
// Here work on TEXTURE matrix
// …
glTexGenfv(GL_S, GL_OBJECT_PLANE, xPlane);
glTexGenfv(GL_T, GL_OBJECT_PLANE, yPlane);
glTexGenfv(GL_R, GL_OBJECT_PLANE, zPlane);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);