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

fitOf function

Px per unit that fits the device in the box in its rest pose, and the shift that centres it: the corners of its parts turned by pitch and yaw, each grown by the perspective of its depth seen from `distance` px.

View as Markdown
import { fitOf } from '@dioramajs/model/device'

.

function fitOf(
  built: Built,
  pose: readonly [number, number],
  width: number,
  height: number,
  distance: number,
): Fit

Parameters

NameTypeDescription
builtBuilt
posereadonly [number, number]
widthnumber
heightnumber
distancenumber

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