threejs打造一个穿越洞穴立体线条动画
代码语言:html
所属分类:三维
代码描述:threejs打造一个穿越洞穴立体线条动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { margin: 0; overflow: hidden; } </style> </head> <body translate="no"> <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/three.r118.js"></script> <script> window.addEventListener("load", init); function init() { const width = window.innerWidth; const height = window.innerHeight; const renderer = new THREE.WebGLRenderer(); document.body.appendChild(renderer.domElement); const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 1000); camera.position.z = 500; const points = [ [60, 180], [120, 240], [180, 300], [280, 180], [180, 120], [60, 60], [60, 180]]; for (let i = 0; i < points.length; i++) { const x = points[i][0]; const y = points[i][0]; const z = points[i][1]; points[i] = new THREE.Vecto.........完整代码请登录后点击上方下载按钮下载查看
网友评论0