Vuer

Frustum

The Frustum component visualizes camera frustums in 3D space. This is ideal for:

  • Visualizing camera field of view
  • Debugging camera placements
  • Displaying camera trajectories
  • Creating multi-camera visualization setups

Basic Usage

A minimal example that creates a camera frustum:

python
from vuer import Vuer, VuerSession
from vuer.schemas import DefaultScene, Frustum, OrbitControls

n, N = 12, 12**3

app = Vuer()

@app.spawn(start=True)
async def main(sess: VuerSession):
    sess.set @ DefaultScene(
        *[
            Frustum(
                key=f"frustum-{i}",
                scale=10,
                showImagePlane=True,
                showFrustum=False,
                showFocalPlane=False,
                position=[i % n, (i // n) % n, (i // n**2) % n],
                rotation=[0.5 * 3.14, 0, 0],
            )
            for i in range(N)
        ],
        up=[0, 0, 1],
        bgChildren=[
            OrbitControls(key="OrbitControls")
        ],
    )

    await sess.forever()

Key Parameters

ParameterTypeDescription
keystrUnique identifier for the frustum
positiontuple[float, float, float]Position of the frustum in 3D space
rotationtuple[float, float, float]Rotation of the frustum (Euler angles)
matrixtuple[float, ...]16-element transformation matrix (overrides position and rotation)
aspectfloatAspect ratio (width/height) of the camera
focusfloatFocus distance
fovfloatVertical field of view in degrees
nearfloatNear clipping plane distance
farfloatFar clipping plane distance
scalefloatScale factor for the frustum visualization
upScalefloatScale factor for the up direction indicator
focalLengthfloatFocal length of the camera
showUpboolWhether to show the up direction indicator
showFrustumboolWhether to show the frustum wireframe
showFocalPlaneboolWhether to show the focal plane
showImagePlaneboolWhether to show the image plane
srcstrSource image to display on the image plane
colorOriginColorRepresentationColor of the camera origin marker
colorFrustumColorRepresentationColor of the frustum wireframe
colorConeColorRepresentationColor of the cone
colorFocalPlaneColorRepresentationColor of the focal plane
colorUpColorRepresentationColor of the up direction indicator
colorTargetColorRepresentationColor of the target marker
colorCrossColorRepresentationColor of the cross marker

Learn More