> I am trying to project a texture on the scenario background. A priori
> everything is setup correctly and the code should
> work but at the end I only get a projection on the screen space.
> picture here :
hmm, don't have the time to delve deeper into your example, but you seem to
be using the same projection matrix for light and camera, so the outcome is
keep in mind that OpenGL will multiply the texgen matrix with the inverse
of the camera matrix at time of specification. So you have to make sure that
modelview is set to the camera view at that point. If you use the
light point of view, the texgen results in an identity transform + projection.
If the light projection matrix matches the camera, fragment and
texture coordinates will be identical (modulo bias), thus the screen plane
alignment of your projection.
Also, a possible caveat: depending on the storage layout of SGMatrix, you
might need to feed OpenGL the transposed texgen matrix as plane vectors (and
use the transposed bias matrix i have seen lying around :-)).
Flightgear-devel mailing list