pick

fun pick(ray: Ray, scene: Scene, result: Cartesian3? = definedExternally): Cartesian3?(source)

Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.

// find intersection of ray through a pixel and the globe
const ray = viewer.camera.getPickRay(windowCoordinates);
const intersection = globe.pick(ray, scene);

Return

The intersection or undefined if none was found.

Parameters

ray

The ray to test for intersection.

scene

The scene.

result

The object onto which to store the result.

See also