Skip to main content

Function: transformRgbUvToWorld()

transformRgbUvToWorld(rgbUv, depthMeshSnapshot, cameraParametersSnapshot): { depthInMeters: number; worldNormal: Vector3; worldPosition: Vector3; } | null

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

Raycasts to the depth mesh to find the world position and normal at a given UV coordinate.

Parameters​

rgbUv​

Vector2

The UV coordinate to raycast from.

depthMeshSnapshot​

Mesh

The depth mesh to raycast against.

cameraParametersSnapshot​

Parameters of the device camera relative to the render camera's world.

worldFromClip​

Matrix4

worldFromView​

Matrix4

Returns​

{ depthInMeters: number; worldNormal: Vector3; worldPosition: Vector3; } | null

The world position, normal, and depth at the given UV coordinate.