How to fix Earth axis along Y axis?

Is there a way to freeze Earth axis from bending left or right? I want it have the constant 0° angle relative to Y axis, no matter what I’m doing. Currently even zooming in and out makes Earth to rotate in random directions. In other words how prevent “compass arrow” from arbitrary rotations?

Hello,

The easiest way to do this is with a preRender event. Here is an example:

var viewer = new Cesium.Viewer(‘cesiumContainer’);
var camera = viewer.scene.camera;
viewer.scene.preRender.addEventListener(function() {
camera.setView({
orientation: {
heading: 0,
pitch: camera.pitch,
roll: camera.roll
}
});
});

``

Best,

Hannah

Thank you for the reply.

Is this the only code I need to get the desired behavior of the camera?

Would you clarify, how to use this solution?

You can insert the preRender event in the code right after you call new Cesium.Viewer to add the globe to the window.

-Hannah

It does not seem to work. I can also rotate the global anywhere

在 2017年1月13日星期五 UTC+8下午11:03:12,Hannah Pinkos写道:

@Onkel Tem have you found any solution of the problem? thank

在 2017年1月13日星期五 UTC+8上午10:13:46,Onkel Tem写道:

@Onkel Tem have you found any solution of the problem? thank

No :frowning: