three实现三维卡片排列围成一圈效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维卡片排列围成一圈效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body{ overflow: hidden; margin: 0; } </style> </head> <body translate="no"> <script type="importmap"> { "imports": { "three": "//repo.bfw.wiki/bfwrepo/js/module/three/build/170/three.module.js", "three/addons/": "//repo.bfw.wiki/bfwrepo/js/module/three/examples/170/jsm/" } } </script> <script type="module"> // https://discourse.threejs.org/t/3d-horizontal-caoursel/73484/6 import * as THREE from "three"; import { OrbitControls } from "three/addons/controls/OrbitControls.js"; import { mergeGeometries } from "three/addons/utils/BufferGeometryUtils.js"; console.clear(); let scene = new THREE.Scene(); scene.background = new THREE.Color(0xaaaaaa); let camera = new THREE.PerspectiveCamera(30, innerWidth / innerHeight, 1, 100); camera.position.set(0, 0.125, 1).setLength(16); let renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setPixelRatio(devicePixelRatio); renderer.setSize(innerWidth, innerHeight); document.body.appendChild(renderer.domElement); window.addEventListener("resize", (event) => { camera.aspect = innerWidth / in.........完整代码请登录后点击上方下载按钮下载查看
网友评论0