pickEllipsoid
fun pickEllipsoid(windowPosition: Cartesian2, ellipsoid: Ellipsoid? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3?(source)
Pick an ellipsoid or map.
const canvas = viewer.scene.canvas;
const center = new Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
const ellipsoid = viewer.scene.ellipsoid;
const result = viewer.camera.pickEllipsoid(center, ellipsoid);
Content copied to clipboard
Return
If the ellipsoid or map was picked, returns the point on the surface of the ellipsoid or map in world coordinates. If the ellipsoid or map was not picked, returns undefined.
Parameters
windowPosition
The x and y coordinates of a pixel.
ellipsoid
The ellipsoid to pick. Default value - Ellipsoid.default
result
The object onto which to store the result.