ThreePipe
    Preparing search index...

    Interface SnapObjectOptions

    interface SnapObjectOptions {
        camera?: PerspectiveCamera<Object3DEventMap>;
        camOffset?: Vector3;
        channel?: number;
        mimeType?: string;
        outputColorSpace?: ColorSpace;
        resources?: SnapObjectResources;
        root?: Scene<Object3DEventMap>;
        samples?: number;
        size?: number | { height: number; width: number };
        toneMapping?: SnapObjectToneMapping | null;
    }
    Index

    Camera to use. Pass the same camera when snapping repeatedly: three.js keeps some state per camera (like the transmission target). Default: a new PerspectiveCamera(45, 1, 0.1, 1000)

    camOffset?: Vector3

    Camera position from the centre of the object's bounds, in units of the largest side of the bounds. Default (0, 0, 1.5)

    channel?: number

    Layer (channel) to render. The object and its children are added to it for the snapshot, the camera renders only it. 0 or less renders all the layers. Default 7

    mimeType?: string

    Image type of the data url of snapObject with size. Default image/png

    outputColorSpace?: ColorSpace

    Colour space of the offscreen output: SRGBColorSpace (default, as the viewer's ScreenPass.outputColorSpace) or linear (any other value).

    Render targets and material to reuse between offscreen snapshots. Without it, they are created and disposed in each call. The caller disposes it.

    Scene to render, the object must be in it. Without it, the object is rendered alone.

    samples?: number

    MSAA samples of the offscreen render (WebGL 2). Default 4

    size?: number | { height: number; width: number }

    Size in pixels (a number for a square).

    When set, snapObject renders into a small offscreen target of this size and reads back only that target, with toneMapping and outputColorSpace applied. The canvas is not changed, so there is no need to call viewer.setDirty() after it.

    When not set, snapObject renders to the canvas and reads the whole canvas (the old behaviour, see snapObject). snapObjectPixels and snapObjectToCanvas always render offscreen, default 256.

    toneMapping?: SnapObjectToneMapping | null

    Tone mapping of the offscreen render, see SnapObjectToneMapping. Use materialPreviewOptionsFromViewer to get the values of the viewer. Default: none