three实现三维隧道穿梭动画效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维隧道穿梭动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body,html{width:100%;height:100%;padding:0;margin:0;overflow: hidden;} </style> </head> <body> <canvas id="scene"></canvas> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.75.js"></script> <script> var ww = window.innerWidth, wh = window.innerHeight; function init(){ /* WEBGL RENDERER */ renderer = new THREE.WebGLRenderer({canvas : document.getElementById('scene')}); renderer.setSize(ww,wh); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera(50, ww/wh, 1, 10000 ); scene.add(camera); light = new THREE.PointLight(0xffffff, 1, 1300); light.position.set( 0, 0, -750 ); scene.add(light); createBox(); animate(); }; function createBox(){ elements = new THREE.Object3D(); var colors = [ new THREE.Color( 0x2cc6e5 ), new THREE.Color( 0x91f4f4 ), new THREE.Color( 0xe6a09e ), new THREE.Color( 0x1071ac ) ]; var geometry = new THRE.........完整代码请登录后点击上方下载按钮下载查看
网友评论0