Scene3D.tsx

src/views/Scene3D.tsx
import { Canvas, useFrame, useThree } from '@react-three/fiber';
import { Grid, Html, OrbitControls, PerspectiveCamera } from '@react-three/drei';
import { useEffect, useMemo, useRef, useState } from 'react';
import { TOUCH, Vector3 } from 'three';
import { useSceneStore } from '../scene/store';
import { Wall3D } from './three/Wall3D';
import { Opening3D } from './three/Opening3D';
import { Floor3D } from './three/Floor3D';
import { Fixture3D } from './three/Fixture3D';
import { Compass } from './Compass';
import { ZoomControls } from '../ui/ZoomControls';
import { describeById, type Selected3D } from '../scene/describe';
import type { Scene } from '../scene/schema';
function sceneCenter(scene: Scene) {
let minX = Infinity;
let minY = Infinity;
let maxX = -Infinity;
let maxY = -Infinity;
for (const w of scene.level.walls) {

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC