camera.setView() does not work

hi,

I want to set the initial view of the camera when the scene first loads. according to the camera tutorial (http://cesiumjs.org/tutorials/Camera-Tutorial/) it should be as easy as:

const viewer = new Cesium.Viewer('cesiumContainer', viewerOptions);
const startPos = Cesium.Cartesian3.fromDegrees(4.8951722, 52.3710947, 150000);
viewer.camera.setView({ position: startPos });

this does not have any effect. – flying to a position however works fine:

viewer.camera.flyTo({ destination: startPos });

am I missing s.th. here?

thanks a lot in advance!

Hello,

Sorry, the code example is outdated in that tutorial. I’ll update that now.

Use this instead:

viewer.camera.setView({
destination: startPos
orientation: {
heading: heading,
pitch: pitch,
roll: roll
}
});

``

Best,

Hannah

I also just realized that. — thanks hannah.