Skip to content

worldToScreen

worldToScreen(p, cam, pose): ScreenPoint | null

Defined in: src/modules/camera-3d/project.ts:42

Project the world point p to the screen: x / y in pixels from the viewport’s top-left (y down), depth along the view axis. Returns null for a point on or behind the camera plane, which has no screen position.

A point outside the viewport or beyond the clip planes still projects, to coordinates outside [0, viewportW] × [0, viewportH]; test with frustumContainsPoint when visibility is the question.

Vec3

Camera3D

CameraPose

ScreenPoint | null