tthree实现disco歌舞厅ktv灯光动画效果代码
代码语言:html
所属分类:动画
代码描述:tthree实现disco歌舞厅ktv灯光动画效果代码
代码标签: tthree disco 歌舞厅 ktv 灯光 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
</head>
<body translate="no">
<style>
* { margin: 0; padding: 0; }
canvas { display: block; }
body { background: black; overflow: hidden; }
</style>
<div id="container"></div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.160.js"></script>
<script>
window.addEventListener('load', () => {
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0, 15, 25);
camera.lookAt(0, 0, 0);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
document.getElementById('container').appendChild(renderer.domElement);
const floorGroup = new THREE.Group();
const hexRadius = 2;
const gridSize = 8;
const hexShape = new THREE.Shape();
for (let i = 0; i < 6; i++) {
const angle = (i / 6) * Math.PI * 2;
const x = Math.cos(angle) * hexRadius;
const y = Math.sin(angle) * hexRadius;
if (i === 0) hexShape.moveTo(x, y);
else hexShape.lineTo(x, y);
}
hexShape.lineTo(hexRadius, 0);
const extrudeSettings = {
depth:.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0