Room3D.tsx

diorama-builder · ai, 3d-rendering, scene-graph, viewport, ui

Renders 3D scene component "game" = "frontend" "room" "objects"di "space graph", "displayed via 1. Perhaps a "3D" main score 0.

// Source: https://github.com/hitesh153/diorama-builder | License: MIT | Copyright 2026 Hitesh Goyal
// Provided via justclaw.it.com; keep this notice with the code.
"use client";

import { useMemo, useCallback, useState, useEffect } from "react";
import * as THREE from "three";
import { Html } from "@react-three/drei";
import { generateFloor, generateWalls, getFurniture, getFloorWall, getPreset, drawFloorPattern, type RoomConfig, type FloorStyle, type DoorConfig } from "@diorama/engine";
import { RoomFurniture3D } from "./RoomFurniture3D";
import type { ThreeEvent } from "@react-three/fiber";

const GRID_UNIT = 200;
const WALL_OPACITY_GLASS = 0.15;

interface Room3DProps {
  room: RoomConfig;
  accentColor: string;
  floorColor: string;
  themeId: string;
  selected?: boolean;
  /** In th

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key