API

Function projectWorldToScreenToRef

  • Project a world-space point into canvas backing pixels and canvas-relative CSS pixels, writing every output field into result.

    view is required separately from viewProjection so behindCamera works for orthographic projections, whose homogeneous W remains 1. Coordinates are not clamped: finite offscreen points keep their extrapolated positions for edge-indicator placement.

    This function performs no allocations. When the matrices use a rebased coordinate frame, set options.worldOrigin to the absolute world position represented by their origin. Derive the matrices and viewport once per frame with getViewMatrix, getViewProjectionMatrix, getEffectiveAspectRatio, and resolveCameraViewport, then reuse both options and result for each projected point.

    Type Parameters

    Parameters

    Returns T