Suppose I have a viewing plane vn
, with an orientation q1
and a plane in the scene un
with an orientation q2
.
q1
and q2
are quaternions.
How would I find the unknown point ux, uy, uz
such that proj_u_plane_vn
is equal to a known point vx, vy, 0
?
Would the problem be simpler by finding the relative orientation q2-q1
?
Right now I'm trying to do it with i, j and k values, but it seems like overkill and I'm not seeing the answer pop out without doing inverse trig, not that I would mind that, but I'm looking for a more elegant solution.
Thanks in advance. :)
You have the following values:
vx, vy, vz; //These are the points in the viewing plane, which you know.
q1, q2; //The vectors describing the viewing and scene planes.
As you suspected, the trick to projection between planes is in using the relative orientations.
You should use your offsets (when you find the relative orientations) between planes to treat the scene plane as if it is offset from the front plane (the viewing plane). This is not only easier to visualize, but it will also make the answers which you looked up more relevant.
Knowing this, you can use your relative orientation to define n in the following equation:
q_proj = q - dot(q - p, n) * n
The projection of a point q = (x, y, z) onto a plane given by a point p = (a, b, c) and a normal n = (d, e, f).
Note that this answer was ripped from here: How do I find the orthogonal projection of a point onto a plane.