Skip to main content

Function: transformRgbUvToWorld()

transformRgbUvToWorld(rgbUv, depthArray, viewProjectionMatrix, matrixWorld, xrDeviceCamera?, xrDepth?): null | Vector3

Defined in: src/camera/CameraUtils.ts:130

Retrieves the world space position of a given RGB UV coordinate. Note: it is essential that the coordinates, depth array, and projection matrix all correspond to the same view ID (e.g., 0 for left). It is also advised that all of these are obtained at the same time.

Parameters

rgbUv

The RGB UV coordinate, e.g., { u: 0.5, v: 0.5 }.

u

number

v

number

depthArray

Array containing depth data.

number[] | Uint16Array<ArrayBufferLike> | Float32Array<ArrayBufferLike>

viewProjectionMatrix

Matrix4

XRView object with corresponding projection matrix.

matrixWorld

Matrix4

Matrix for view-to-world translation.

xrDeviceCamera?

XRDeviceCamera

The device camera instance.

xrDepth?

The SDK's Depth module.

undefined | Depth

Returns

null | Vector3

Vertex at (u, v) in world space.