Three.js Modern House Walkthrough (Interior Architecture)

An architectural walkthrough of a furnished modern house in Three.js, with open-plan living, kitchen, dining, bedroom and bath, floor-to-ceiling glazing with transmission, a pool deck, soft shadows, RoomEnvironment reflections and an automatic camera tour.

Key topics: architectural visualization, house walkthrough, three.js interior, archviz, meshphysicalmaterial, room environment

What this code does

- Walls With Openings: a helper walks along each wall, emitting solid boxes between openings, sill and head pieces around windows, and glass panes inside.
- Glazing: MeshPhysicalMaterial with transmission makes the south facade read as glass while letting sunlight cast shadows inside.
- Lighting: a directional sun with PCF soft shadows, RoomEnvironment through PMREM for reflections, and warm ceiling point lights.
- Walkthrough: a shared tour helper moves the camera along a CatmullRom path at eye height; dragging pauses it and it eases back after a few seconds.
- Cutaway: hide the roof to see the plan from above, or keep it for daylight studies.
- Controls: time of day, roof, interior lights and walkthrough.

Continue Learning

JavaScript Implementation

ES6+
// Walls with openings: emit solid boxes between openings, plus sill/head pieces and glass

function wall (x0, z0, x1, z1, openings) {
  const len = Math.hypot(x1 - x0, z1 - z0), g = new THREE.Group()
  g.position.set(x0, 0, z0); g.rotation.y = -Math.atan2(z1 - z0, x1 - x0)
  let t = 0
  for (const [a, b, sill, head] of openings) {
    if (a > t) g.add(box(a - t, H, T, (t + a) / 2))           // solid section
    if (sill) g.add(box(b - a, sill, T, (a + b) / 2, sill / 2)) // below the window
    g.add(box(b - a, H - head, T, (a + b) / 2, (H + head) / 2)) // above the opening
    t = b
  }
  if (t < len) g.add(box(len - t, H, T, (t + len) / 2))
  return g
}