threejs打造三维立体ascii球体运动动画代码
代码语言:html
所属分类:三维
代码描述:threejs打造三维立体ascii球体运动动画代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <style> body { font-family: Monospace; background-color: #f0f0f0; margin: 0px; overflow: hidden; } </style> </head> <body> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.58.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/TrackballControls.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/AsciiEffect.js"></script> <script> var container, stats; var camera, controls, scene, renderer; var sphere, plane; var start = Date.now(); init(); animate(); function init() { var width = window.innerWidth || 2; var height = window.innerHeight || 2; container = document.createElement( 'div' ); document.body.appendChild( container ); var info = document.createElement( 'div' ); info.style.position = 'absolute'; info.style.top = '10px'; info.style.width = '100%'; info.style.textAlign = 'center'; info.innerHTML = 'Drag to change the view'; container.appendChild( info ); camera = new THREE.PerspectiveCamera( 70, width / height, 1, 1000 ); camera.position.y = 150; camera.position.z = 500; controls = new THREE.TrackballControls( camera ); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0