Hello,
I used the example http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Camera.html&label=Showcases
to implement pinning of view to a certain location.
However, the problem is that when I am doing it, the camera "flies" to some location ( as specified in the call to camera.lookAtTransform(transform, position).
What I need is when I am clicking on a globe (creating an object at the location that I clicked on), I need to pin the view to that location but I don't want the camera to move at that moment.
I tried using camera.setView(...), but it causes camera to "fly" to that location.
Here is my code: (x,y) is the Windows click coord.
var position = camera.pickEllipsoid({x:x, y:y}, ellipsoid);
var cameraViewData = {
'destination' : this._ctx.camera.position,
'orientation' : {
'heading' : this._ctx.camera.heading,
'pitch' : this._ctx.camera.pitch,
'roll' : this._ctx.camera.roll
}
};
var transform = Cesium.Transforms.eastNorthUpToFixedFrame(position);
camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z;
//the following line causes camera to move, but without it the view isn't pinned to the location when zooming in/out.
camera.lookAtTransform(transform, position);
//flies to the location, but I want to keep the same view as it was before I called this function to pin the view
camera.setView( cameraViewData );
Thank you,
Greg