three实现穿越隧道动画效果代码

代码语言:html

所属分类:动画

代码描述:three实现穿越隧道动画效果代码

代码标签: three 穿越 隧道 动画

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

<!DOCTYPE html>
<html lang="en">

<head>

   
<meta charset="UTF-8">






   
<style>
        body
{
         
overflow: hidden;
         
margin: 0;
       
}
   
</style>



</head>

<body>
   
<canvas></canvas>


   
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.88.js"></script>
   
<script>
        // Get window size
        const canvas = document.querySelector('canvas');
       
        canvas.width = window.innerWidth,
        canvas.height = window.innerHeight;
       
        // Create a WebGL renderer
        const renderer = new THREE.WebGLRenderer({ canvas });
       
        renderer.setSize(canvas.width, canvas.height);
       
        // Create an empty scene
        const scene = new THREE.Scene();
       
        // Create a perpsective camera
        const camera = new THREE.PerspectiveCamera(65, canvas.width / canvas.height, 0.001, 1000);
        camera.position.z = 400;
       
        const ambient = new THREE.AmbientLight(0xffffff, 0.75);
        scene.add(ambient);
       
        // Array of points
        const points = [
        [6.........完整代码请登录后点击上方下载按钮下载查看

网友评论0