Hi,
In our product we produce a view_matrix
that represents the orientation of a drone as it takes a picture. This works fairly well, we compute the view simply like this:
getView(): any {
const destination = Matrix4.multiplyByPoint(this.view_matrix, Cartesian3.ZERO, new Cartesian3())
const direction = Matrix4.multiplyByPointAsVector(this.view_matrix, Cartesian3.UNIT_Z, new Cartesian3())
const up = Matrix4.multiplyByPointAsVector(this.view_matrix, Cartesian3.UNIT_Y, new Cartesian3())
const view = {
destination,
orientation: { direction, up },
}
return view
}
However we now also have some drone positions for which we only have heading, pitch and roll, not a view_matrix
. So to make things uniform I want to compute the view_matrix
from the HeadingPitchRoll
.
There’s some functions in Cesium.Transforms
that seem to implement this, but none of them seem to produce the same results.
Below is an attempt to compute the HeadingPitchRoll from the view_matrix
and you can see that the Cesium.Transforms.fixedFrameToHeadingPitchRoll
function does not produce the same results.
Does anyone have an idea about what this type of view matrix is called, and maybe what set of functions do work with it? I tried a bunch of stuff, also for example extracting the Matrix3, transforming it to ENU and then using Quaternion to convert it to HeadingPitchRoll but that also failed to give the same result.