Imagine I have a origin Point A at some certain coordinate at an height of 0m.
Now I want to get the Vector between the camera position (Point B) and that Point A.
Usually I could just use
Cartesian3.subtract(PointB, PointA)
, but I do not want to have it in world space, but local Point A space.
E.g.: If camera is exactly 10 meters above Point A and 1m to the east, I would want to get the Vector (1, 0, 10).
So I thought I can use
Cesium.Transforms.eastNorthUpToFixedFrame(PointA, Ellipsoid.WGS84, transform)
and Matrix4.multiplyByPointAsVector(transform, PointB, localCamVector)
.
But this is not working yet.
Then I also tried to multiplyByPointAsVector
the PointA with Matrix4.multiplyByPointAsVector(transform, PointA, localOriginVector)
and subtracted both with Cartesian3.subtract(localCamVector, localOriginVector)
.
This value seems to be more correct since the value are not thousands of meters long when I have the camera close to the origin, but still is not correct. When I move the camera to the east I can still see that x,y,z is manipulated and not just x.