Models and mapsA captured splat
Add a Gaussian splat beside a model
An olive tree drawn as a Gaussian splat beside a bench and a kiosk, its renderer fetched only when the first splat arrives.
What this example defines: its scene and, where it has them, its simulated source and its styling. The page imports and runs this file; the page's own renderer, panels and controls are not in it. For a complete app to run on your machine, download the quickstart starter.
import { createScene, type Scene } from "@klorad/api/world";
/** The splat the sandbox draws: an olive tree in a pot, made of splats by `pnpm --filter @klorad/docs splats`, not a capture. */
export const OLIVE = "/splats/olive.spz";
/** A courtyard of a bench and a kiosk, where a splat is added beside them. */
export function createSplatsDemo(): { readonly scene: Scene } {
const scene = createScene({ name: "Courtyard", coordinateSystem: { origin: { lat: 40.6323, lon: 22.9518 } } });
scene.add({ id: "bench", name: "Bench", position: { east: 2.2, north: -0.6 }, orientation: { heading: 20 }, geometry: { kind: "box", width: 1.6, depth: 0.45, height: 0.45 } });
scene.add({ id: "kiosk", name: "Kiosk", position: { east: -3, north: 1.5 }, scale: 0.4, geometry: { kind: "model", uri: "/models/kiosk.glb" } });
return { scene };
}
/** Adds the olive tree; Spark is fetched now, with the first splat, and not before. */
export function addOlive(scene: Scene) {
return scene.add({ id: "olive", name: "Olive tree", position: { east: 0, north: 0 }, geometry: { kind: "splat", uri: OLIVE, capturedAt: "2026-10-29T10:00:00Z" } });
}Anchor40.63230° N 22.95180° E
East, north+0.0 m +0.0 m
Digital ObjectDigital ShadowDigital TwinStale