three实现三维公寓7种房间内饰场景效果代码

代码语言:html

所属分类:三维

代码描述:three实现三维控制小人走扶梯上楼场景代码,有厨房、卫生间、客厅、办公室、主卧、客卧、起居室、餐厅。

代码标签: three 三维 公寓 7种 房间 内饰 场景 效果 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>3D Apartment Tour - Three.js</title>
  <style>
    html, body {
      margin: 0;
      overflow: hidden;
      background: #dfe6ea;
      font-family: Arial, Helvetica, sans-serif;
    }
    #ui {
      position: absolute;
      top: 12px;
      left: 12px;
      z-index: 20;
      width: 320px;
      max-height: calc(100vh - 24px);
      overflow: auto;
      background: rgba(255,255,255,0.9);
      border-radius: 14px;
      padding: 14px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.15);
      backdrop-filter: blur(8px);
    }
    #ui h2 {
      margin: 0 0 8px;
      font-size: 20px;
      color: #222;
    }
    #ui p {
      margin: 6px 0 10px;
      color: #444;
      font-size: 13px;
      line-height: 1.5;
    }
    .group-title {
      margin: 12px 0 8px;
      font-size: 13px;
      color: #666;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .btn-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    button {
      border: none;
      background: #1f2937;
      color: white;
      border-radius: 10px;
      padding: 10px 12px;
      cursor: pointer;
      font-size: 13px;
      transition: 0.2s ease;
    }
    button:hover {
      background: #374151;
      transform: translateY(-1px);
    }
    button.secondary {
      background: #8b5cf6;
    }
    button.secondary:hover {
      background: #7c3aed;
    }
    #legend {
      margin-top: 10px;
      font-size: 12px;
      color: #555;
      line-height: 1.5;
    }
    canvas {
      display: block;
    }
  </style>
</head>
<body>
  <div id="ui">
    <h2>Apartment Tour · 145 sqm</h2>
    <p>
      Interactive modern minimalist apartment with 8 furnished rooms:
      living room, kitchen, dining, master bedroom, bathroom, office, guest bedroom, and balcony.
    </p>

    <div class="group-title">Navigate Rooms</div>
    <div class="btn-grid">
      <button data-room="living">Living Room</button>
      <button data-room="kitchen">Kitchen</button>
      <button data-room="dining">Dining</button>
      <button data-room="master">Master Bedroom</button>
      <button data-room="bathroom">Bathroom</button>
      <button data-room="office">Office</button>
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0