(glTexGen) M*p' = p : Which modelview matrix ?

In glTexGen()if the texture generation function is GL_EYE_LINEAR, the texture generation function is:

p1’*xe + p2’*ye + p3’*ze + p4’*we

where (p1’, p2’, p3’, p4’) = (p1, p2, p3, p4)*M^-1

My question is: Which WHICH MODELVIEW MATRIX IS M? I’m thinking it’s that required to transform a “vector”/the normal in the camera/eye view-plane to the object view-plane! Is this so? If not why? …

It’s the MODELVIEW matrix - there is only one modelview matrix (except when using vertex programs, when you can have as many matrices as you can fit into the constants).
There’s two matrices that are used to project your scene into the viewport:-

  1. projection
  2. modelview

There’s also a texture matrix for each texture unit.

Hope this helps.

Originally posted by knackered:
[b]It’s the MODELVIEW matrix - there is only one modelview matrix [b]

I find this very confusing because if q = Mp: where p = (x, y, z, w) is a point/vertex (in object space) and q = (x’, y’, z’, w’) is the eye/camera space equivalent; where M is the modelview matrix, why should the transformation of the object-space vector p = (p1, p2, p3, p4) to the eye-space form p’ = (p1’, p2’, p3’, p4’) be computed the otherway round ?!? p’ = Mp

HELP Pleeeeeze

Have a look there:
http://ask.ii.uib.no/ebt-bin/nph-dweb/dy…html;pt=37821#X

The relationship between the matrix that transforms vertices and the one that transforms vectors is explained.

BTW, what you wrote is wrong (i.e. normals are not transformed by the invert of the matrix that transforms vertices). Instead:

“normal vectors are transformed by the inverse transpose of the transformation that transforms points”

Regards.

Eric

Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You, Thank You