Skip to content

Documentation / @ripl/3d / unprojectPoint

Function: unprojectPoint() ​

unprojectPoint(x, y, depth, inverseViewProjection, viewport): Vector3

Defined in: 3d/src/math/projection.ts:59

Reverses projectPoint, mapping a screen-space point at a given clip depth back into world space.

Parameters ​

ParameterTypeDescription
xnumberScreen-space x, in the same logical pixels projectPoint produces.
ynumberScreen-space y.
depthnumberClip-space depth, 0 at the near plane and 1 at the far plane.
inverseViewProjectionMatrix4The inverse of the view-projection matrix used to project.
viewportViewportThe viewport the point was projected into.

Returns ​

Vector3

The world-space point.