three+TweenMax实现立方体方块上下起伏波动动画效果代码
代码语言:html
所属分类:三维
代码描述:three+TweenMax实现立方体方块上下起伏波动动画效果代码
代码标签: three TweenMax 立方体 方块 上下 起伏 波动
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> </head> <body> <canvas></canvas> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.84.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/TweenMax.min.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.min.js"></script> <script> var renderer, scene, camera, cube; var ww = window.innerWidth, wh = window.innerHeight; function init(){ renderer = new THREE.WebGLRenderer({ canvas : document.querySelector('canvas'), antialias: true }); renderer.setSize(ww,wh); renderer.setClearColor(0xffffff); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera(50,ww/wh, 0.1, 10000 ); camera.position.set(180,180,180); camera.lookAt(new THREE.Vector3(0,0,0)); scene.add(camera); controls = new THREE.OrbitControls(camera); directionalLight = new THREE.DirectionalLight( 0xe6e3b0, 1.0 ); directionalLight.position.set( 350, 0, 0 ); directionalLight.lookAt(new THREE.Vector3(0,0,0)); scene..........完整代码请登录后点击上方下载按钮下载查看
网友评论0