What is the perspective projection of a 3d point relative to a quarternion encoded camera?

411 Views Asked by At

I'm representing a camera on the cartesian space as a tuple of a 3d point (position) and a quarternion (rotation). I get the front, right and up vectors of the camera by applying the quaternion to the the X, Y and Z unit vectors respectivelly. I've found an abundant amont of resources on perspective projections based on matrices, but I couldn't find a formula for this representation. Is there any way to project a 3d point on the screen of such camera that is more efficient than converting it to the matrix representation and using the usual formulas?

1

There are 1 best solutions below

0
On

So you have some position $o$ and unit quaternion $o$. Rotation:

$$ p'=qpq^{-1} $$

reduces to
$$ p'=qpq^{*} $$ where superstar is the conjugate. Plugging in $(1,0,0), (0,1,0), (0,0,1)$ gives you forward, right, up (depending on convention) which are equivalent to converting to a rotation matrix.

To directly transform some point $a$, then $p=a-o$ and apply the rotation. If you have only one point to transform then it's slightly cheaper to directly compute from the quaternion equation if the derivation has been carried through. Otherwise converting to a matrix is the cheaper option.