PDA

View Full Version : Projected Triangle



What3v3r
09-01-2002, 03:44 AM
Hi, i have some doubts about pretty easy stuff like transformations. So, here is my questions.:

I have one light vector (0.5, 0.0, -1.0) in world space and i have one object that is placed at (0.5, 0.0, -3.0). To transform the light vector(world space) to objec space i'm doing this:

(Tx, Ty, Tz) = (0.5, 0.0, -3.0) - (0.0, 0.0, 0.0) resulting in (0.5, 0.0, -3.0) which is the object coordinates. Now i build a matrix like this:
Tx = 0.5;
Ty = 0.0;
Tz = -3.0;

1 0 0 Tx
0 1 0 Ty
0 0 1 Tz
0 0 0 1

and then i mutiply the light vector(in world space) with that matrix.

The new(transformed) light vector should be one "line" from object space to ligth coordinates, if so than the new(transformed) light vector should be (0.0, 0.0, 2.0) and doing that transformation with the matrix this isn't the result.

Anyone to get me clear with this please ?

Thanks

What3v3r
09-01-2002, 03:47 AM
Ups...i forgot to tell you that this is to project a triangle against a surface, something like this:

I have a surface positioned with a high z value, i have one light the pointview and a trinagle in the middle and the triangle should be projected in the surface behind it, like a shadow...

Thanks http://www.opengl.org/discussion_boards/ubb/smile.gif