**What is the correct approach to get a ground point lat/lng from and aerial model (****lat/lng/altitude)**with a camera (heading/angle)?
Thanks in advance!
Best Regards,
Chris
**What is the correct approach to get a ground point lat/lng from and aerial model (****lat/lng/altitude)**with a camera (heading/angle)?
Thanks in advance!
Best Regards,
Chris
Hi Chris,
Sorry, what do you mean? Do you mean, how to get the point at the center of the current camera view?
If so, what you need is something like the following:
var screenCenter = new Cesium.Cartesian2();
var canvas = viewer.canvas;
screenCenter.x = Math.floor(canvas.clientWidth / 2);
screenCenter.y = Math.floor(canvas.clientHeight / 2);
var position = viewer.scene.camera.pickEllipsoid(screenCenter);
``
Use viewer.scene.globe.pick() instead of viwer.scene.camera.pickEllipsoid if you want the pick to be sensitive to terrain height.
See here for examples in action: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Picking.html&label=Showcases
Hope that helps!
Hey Rachel,
Sorry for the lack of detail. I have an airplane model rendered in my map that has an onboard camera with a heading and an angle pointing down towards the globe. I want to get the lat/lng of the ground point that the center of the onboard camera is looking at given the airplane model lat/lng/alt and the properties of the direction that the camera is looking.
Does that make sense?
Best Regards,
Chris
Hi Chris,
Yes that makes sense! That’s what the code I’ve given you should do.
Best,