Hi Dan,
So I’ve been trying this quite a lot and struggling with it a fair bit! Figuring out the whole direction / up etc is pretty tricky. (An explanation of what is what would be good). I presume the direction is the way the camera is facing? And the up? The angle at which it is looking? That’s what I would logically expect but how can the “up” have to be in a Cartesian3 format.
Anyway - what I’ve got is the following:
Two points;
p1
Cartesian3 {x: 2262525.9099753425, y: 833478.7857226268, z: 5885024.111380975, getMaximumComponent: function, getMinimumComponent: function…}
- x: 2262525.9099753425
- y: 833478.7857226268
- z: 5885024.111380975
-
p2
Cartesian3 {x: 6620669.785912072, y: 597247.5672878108, z: -2455418.580647144, getMaximumComponent: function, getMinimumComponent: function…}
- x: 6620669.785912072
- y: 597247.5672878108
- z: -2455418.580647144
And what I would like is for the camera to fly to a location and then pan to a view that would mean that p1 is in the foreground, visible, and p2 is visible in the background.
This is what I’ve got so far;
var destination = ellipsoid.cartesianToCartographic(p1);
destination.height = 1000000;
moveEarth = false;
activateFlyBy = false;
var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
destination: destination,
direction: p2,
// up: p2,
onComplete: function () {
var camera = scene.getCamera();
//camera.transform = Cesium.Transforms.eastNorthUpToFixedFrame(p2);
camera.controller.lookAt(camera.getPositionWC(), p1, p1);
}
});
So the flight flies to the location of p1 (at a static height as defined), fine. Then I’m trying to set the view - but completely lost as to how. I get some pretty psychedelic animations happening, which are cool - but unwanted!
Any help would be appreciated.
Thanks
Toby