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

bake function

Bakes the distance from the ink along `dir` (box px, y down) up to `reach` px: 0 at the ink, 255 at `reach` or with no ink behind.

View as Markdown
import { bake } from '@dioramajs/text/extrude'

. Doubling: each pass takes the smaller of a pixel and the pixel s back plus s, for s = 1, 2, 4…, so log2 of the reach in canvas draws.

function bake(
  layout: Raster,
  dir: readonly [number, number],
  reach: number,
): Baked | undefined

Parameters

NameTypeDescription
layoutRaster
dirreadonly [number, number]
reachnumber

Defined in packages/text/src/extrude.ts.