three实现三维北京四合院展示效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维北京四合院展示效果代码,gemni3生成
下面为部分代码预览,完整代码请点击下载或在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>
body { margin: 0; overflow: hidden; background-color: #87CEEB; }
#info {
position: absolute;
top: 10px;
width: 100%;
text-align: center;
color: #333;
font-family: 'Kaiti', 'SimKai', serif;
font-size: 24px;
font-weight: bold;
text-shadow: 1px 1px 2px white;
pointer-events: none;
}
</style>
<!-- 引入 Three.js -->
<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>
</head>
<body>
<div id="info">北京四合院 - 3D 模型 </div>
<script type="module">
import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
let scene, camera, renderer, controls;
const materials = {};
init();
animate();
function init() {
// 1. 场景
scene = new THREE.Scene();
scene.background = new THREE.Color(0x87CEEB.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0