import { createScene } from "@klorad/api/world";
import type { CameraView } from "@klorad/engine-three";
/** A small exhibition room: a scanned piece on a plinth in the middle, two more along the walls. */
export function createVrDemo() {
const scene = createScene({ name: "Exhibition room", coordinateSystem: { origin: { lat: 40.632, lon: 22.951, height: 12 } } });
scene.add({ id: "floor", name: "Floor", position: { east: 0, north: 0 }, geometry: { kind: "box", width: 16, depth: 12, height: 0.05 }, color: "#3a3f47" });
scene.add({ id: "plinth", name: "Plinth", position: { east: 0, north: 0 }, geometry: { kind: "box", width: 1.2, depth: 1.2, height: 0.9 } });
// why: a laser scanner gives an STL; the renderer reads it like any other model and turns it Z up to Y up
scene.add({ id: "piece", name: "Scanned piece", position: { east: 0, north: 0, up: 0.9 }, scale: 1, geometry: { kind: "model", uri: "/models/pump.stl" } });
scene.add({ id: "stele", name: "Stele", position: { east: -6, north: 4 }, geometry: { kind: "box", width: 0.8, depth: 0.3, height: 2.2 } });
scene.add({ id: "column", name: "Column", position: { east: 6, north: -4 }, geometry: { kind: "cylinder", radius: 0.35, height: 3 } });
return { scene };
}
/** The observation points of the room, in the order a visitor walks them; the first is where they start. */
export const STOPS: readonly { readonly name: string; readonly view: CameraView }[] = [
{ name: "Entrance", view: { target: { east: 0, north: 0, up: 1.6 }, heading: 0, tilt: 5, distance: 6 } },
{ name: "The scanned piece", view: { target: { east: 0, north: 0, up: 1.2 }, heading: 135, tilt: 15, distance: 2.5 } },
{ name: "Stele", view: { target: { east: -6, north: 4, up: 1.5 }, heading: 315, tilt: 5, distance: 3 } },
{ name: "Column", view: { target: { east: 6, north: -4, up: 1.8 }, heading: 135, tilt: 5, distance: 3.5 } },
];