setting camera direction from heading tilt & roll?


I wonder what is the best way to set the camera direction in a Cesium
Viewer, if a heading, tilt & roll values are given, in degrees? sample
values are like:

heading: 102.7
tilt: 94.6
roll: -1.09

which would be an orientation towards 102.7 degrees, looking a bit up
(90 degrees would be 'level') and rolling 1 degrees to the right.

I see that the Camera object has direction up and right values, which
are Cartesian3 in type, but it is not obvious for me on how to set
them, after having looked at the Camera Tutorial, Camera Sandcastle
demo, reference documentation, etc.

best regards,


Dan would be the best guy to help you here, but since he won’t be around until next week, I’m going to write up a Cesium issue because this is something we should definitely do.

You can set camera properties directly. In this case you would need to set up, right, position, and direction.

I’m not strong in Trig, but I believe what you’ll want is to start with a unit vector that points north and is tangent to the surface of the earth under the camera location. Then you would perform elementary rotations for each component from there.

Here’s the issue: