Skip to main content

Type Alias: GetScreenPosition

GetScreenPosition = (points) => Promise<Nullable<object[]>>

Projects world-space points to CSS pixels from the active canvas's top-left corner.

Each point can be an { x, y, z } object or an [x, y, z] tuple. Results preserve input order. inView means the point is inside the camera viewport and depth range. Coordinates can extend beyond the viewport. Returns null when the scene, camera, or projection is unavailable, or any input coordinate is missing or non-finite.

Parameters​

points​

readonly (ProjectionPoint | readonly [number, number, number])[]

Returns​

Promise<Nullable<object[]>>

Example​

const points = await window.mimeeqApp.actions.getScreenPosition([[0, 1, 0]]);
if (points?.[0]?.inView) console.log(points[0].x, points[0].y);