three实现三维桃花庭院场景代码

代码语言:html

所属分类:三维

代码描述:three实现三维桃花庭院场景代码

代码标签: three 三维 桃花 庭院 场景 代码

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

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>圆形拱廊 · 桃花庭院 — Three.js</title>
<style>
  html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1b2a; }
  #app { position: fixed; inset: 0; }
  .ui { position: fixed; z-index: 10; pointer-events: none; color: #fff;
        font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
  .title { top: 22px; left: 26px; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
  .title h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 2px; }
  .title p  { margin: 6px 0 0; font-size: 12px; opacity: .85; }
  .hint { bottom: 18px; left: 50%; transform: translateX(-50%);
          font-size: 12px; padding: 8px 18px; border-radius: 20px;
          background: rgba(10,25,40,.45); backdrop-filter: blur(6px);
          border: 1px solid rgba(255,255,255,.15); }
</style>
</head>
<body>
<div id="app"></div>
<div class="ui title">
  <h1>🌸 圆形拱廊 · 桃花庭院</h1>
  <p>Three.js 实时渲染 — 拱廊建筑 / 星空穹顶 / 实例化草地与花瓣</p>
</div>
<div class="ui hint">左键拖拽旋转 · 滚轮缩放 · 右键平移</div>

<script type="importmap">
{
  "imports": {
    "three": "https://unpkg.com/three@0.160.0/build/three.module.js",
    "three/addons/": "https://unpkg.com/three@0.160.0/examples/jsm/"
  }
}
</script>

<script type="module">
import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import * as BufferGeometryUtils from 'three/addons/utils/BufferGeometryUtils.js';

/* =====.........完整代码请登录后点击上方下载按钮下载查看

网友评论0