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

Wipe class

Where the glass is wiped clear: `size` × `size` cells over the box, each 0 (fogged) to 1 (clear), y up.

View as Markdown
import { Wipe } from '@dioramajs/media/frost'

. A stroke clears a band along the pointer's path; each step the clear areas fog back over refog seconds. Deterministic: the same strokes and steps give the same mask.

class Wipe

Members

NameTypeDescription
constructor
constructor(size: number): Wipe
activeboolean

Some cell is still fogging back.

Default false.

readonly clearFloat32Array
peaknumber

Clearest cell, 0..1.

Default 0.

readonly sizenumber
reset
reset(): void

Fogs every cell at once.

resized
resized(size: number): Wipe

A copy of this mask at size cells a side, nearest cell.

step
step(seconds: number, refog: number, floor?: number): void

Fogs back by seconds out of refog: a fully clear cell is fogged after refog s. With a floor a wiped cell fogs back only down to it, so a thin fog returns instead of all of it.

stroke
stroke(
  ax: number,
  ay: number,
  bx: number,
  by: number,
  radius: number,
  width: number,
  height: number,
): void

Clears the cells within radius px of the segment a–b (box px, y up, box width × height).

write
write(out: Uint8Array): void

Writes the mask into the red channel of RGBA bytes.

Defined in packages/media/src/wipe.ts.