Reputation: 302
I need to calculate the location of the yellow star on the plane, in flat plane Tangent Space.
So first I need to project a vector from the eye, through the pink square, and find the resulting location on the plane (find the yellow star).
Everything is in tangent space already. So I know the location and direction of the eye, and the location of the pink square, in relation to the center of the plane (tangent space).
The resulting yellow star must be on the plane. So its position with respect to the direction of the blue arrow must be always zero. In the above image, it would have a positive value for its position with respect to the green and red arrows.
I've been trying to figure out how to do this using math such as Vector Projection, but I can't seem to wrap my head around it.
Upvotes: 0
Views: 1596
Reputation: 29244
So the camera has 3d location vector r and direction vector e. The plane is defined by z=0
which you use on the equation of the line
z = r_z + t * e_z = 0 } t = -r_z/e_z
the coordinate are then
x = r_x + t * e_x
y = r_y + t * e_y
I assume that everything is already expressed in the desired coordinate system with blue along the z-axis.
Upvotes: 1