Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function projectSphereAreaPx

    • Project a view-space sphere to its screen ellipse area in buffer pixels.

      Perspective: radii scale by P[0]/depth and P[5]/depth (the projection matrix's focal terms); a camera inside or in front of the sphere (depth <= radius) counts as full-buffer. Orthographic: the focal terms apply without the depth division. Off-screen (the ellipse does not touch the NDC square) returns 0; otherwise the ellipse area, clipped to the buffer. The clip is a coarse min, not an exact intersection — the guard only needs the order of magnitude.

      Parameters

      • centerView: { x: number; y: number; z: number }
      • radius: number
      • camera: Camera
      • width: number
      • height: number

      Returns { areaPx: number; onScreen: boolean }