Given a ViewMatrix
setting of the form {t, p}
, how can one determine the ViewVertical
?
Let's say we have
vm = {
{
{0.10402567469787839`, 0.05634724046135078`, 0., 0.06671318616834762`},
{-0.033304268882567746`, 0.061484804090894324`, 0.09542953968274223`, -0.10079092470343654`},
{0.045451481623891156`, -0.08391042761333754`, 0.06992535634444795`, -0.030220722382910785`},
{0.`, 0.`, 0.`, 1.`}
},
{{1.`, 0.`, 0.`, 0.5`}, {0.`, 1.`, 0.`, 0.5`}, {0.`, 0.`, -1, -0.5`}, {0.`, 0.`, 0.`, 1.`}}
};
The (normalized) ViewPoint
can be found with
qr = QRDecomposition[vm[[1]]];
vpn = Sign[Diagonal[qr[[2, 1 ;; 3, 1 ;; 3]]]] qr[[1, 1 ;; 3, 3]]
{0.384185, -0.709265, 0.591054}
Norm[{1.3, -2.4, 2}] * vpn
{1.3, -2.4, 2.}
Can the ViewVertical
be found in a similar fashion?
EulerAngles[]
to recover rotation angles, but retrievingViewVertical
from those does not look immediately obvious to me. $\endgroup$Inverse[vm[[1]]].{0, 1, 0, 0} // Most
? $\endgroup$