PDA

View Full Version : Viewport Space to Light Space



-Moi-
08-30-2005, 05:04 AM
Hello,

I want to transform a point from Viewport Space to Light Space. What are the necessary transformations? I think that it's possible to merge all those transformations in one Matrix.

Thanks :)

cass
08-30-2005, 06:27 AM
Hi -Moi-,

If you concatenate the transforms that take you from light space->eye space->clip space->viewport space, you'll have a 4x4 matrix. Simply invert that matrix to go from viewport space back into light space.

Note that this transform will take you from Real (x,y,z) viewport space into Homogeneous (x,y,z,w) light space. You'll need to divide by w to get to Real light space coordinates.

Thanks -
Cass

-Moi-
08-31-2005, 06:17 AM
Thanks a lot cass

I forget to divide by W. :p Now this works very well