eye linear texture coords

The next thing I plan to learn is projective texture mapping. Do you have any experiences with that?

Nope, but like I said, I do plan to learn it (and spheremap texgen, cubemap texgen, normalmap texgen, and I think thats all there is right now). I suspect now that I have a pretty good understanding of the process, the other texgen modes will come along relatively easy.

I just sent you the app.


I’ve written a description that might help you here:

It uses Performer, a scene graph, but the projective matrix building and transformation to projector position is all vanilla OpenGL calls on the texture matrix stack. The texgen stuff uses scene graph calls but you already know this stuff. The description and diagrams are generic and OpenGL applicable.

The summary is you set up a 3 coordinate texgen and use a glFrustum call to build a projective matrix on the texture matrix stack. You can then transform this to the projector position also using the texture matrix. There are some other details covered in the online description. I use OpenGL calls to directly manipulate the texture matrix rather than roll & load my own. It’s really simple to implement this way, zero matrix math required, just get the multiplication order correct.

You can’t set up the division of s & t by r without the texture matrix. The projection is a matrix operation on texture coords, not purely a texgen operation.

For a scene with animated objects (modelview matrix manipulations above objects in the scene) you need to perform texgen in eye space to transform to world space rather than object space to world space as I did in this demo. If I were writing the demo again I would do texgen in eye space. You just figured this part out in detail so I expect it will be clear to you how to move from eye to world space, from there you transform to projector position as I did in the demo.

[This message has been edited by dorbie (edited 05-30-2002).]