Manuel Massing wrote:

Hello Harald,

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
expected...

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 :-)).

bye,

        Manuel

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

You are right, it is indeed working with another light view matrix.
Thx ;)

Harald.


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to