Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

Rig interface

The placed model of an element, as `model` publishes it.

View as Markdown
import type { Rig } from '@dioramajs/diorama/model/rig'
interface Rig

Members

NameTypeDescription
readonly box{ readonly height: number; readonly width: number; readonly x: number; readonly y: number }

The model element's box this frame, viewport px.

readonly fileObject3D

The file's scene, whose coordinates the markup uses.

readonly pivotGroup

The group model turns. Its rotation is the pose, drag, spin, scroll turn and tilt.

readonly rootObject3D

The model's layer root, at the centre of its box.

readonly sceneGroup

The normalised wrapper from ctx.model: the file's scene is its only child.

contain
contain(boxes: readonly Box3[] | undefined): void

Bounds of parts in the file's coordinates to fit in the box and centre on the pivot instead of the file's own, as parts move apart; undefined goes back to the file's bounds.

face
face(yaw: number, pitch: number): void

Turns the model so that this yaw and pitch (radians, the model's own rotation) face the viewer: through the same easing as the arrow keys, at once under reduced motion. Pitch is held to the model's limit.

invalidate
invalidate(): void

Requests a frame of the element's layer.

Also exported from @dioramajs/model/rig.

Defined in packages/model/src/rig.ts.