three实现炫酷彩色粒子线旋涡动画效果代码
代码语言:html
所属分类:粒子
代码描述:three实现炫酷彩色粒子线旋涡动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> * { margin:0; padding:0 } html { height:100% } body { height:100%; overflow:hidden; background-color:#111 } canvas { position:absolute } .summary { position:absolute; top:1em; right:1em; left:1em; z-index:100000; color:#fff; font-family:'source code pro' } h1 { font-size:1.5em; font-weight:100 } </style> </head> <body> <div class="summary"> <h1>炫酷粒子旋涡网页特效</h1> </div> <div id="canvas"></div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.72.js"></script> <script > (function e(g, b, d) { function f(k, m) { if (!b[k]) { if (!g[k]) { var h = typeof require == "function" && require; if (!m && h) { return h(k, !0) } if (a) { return a(k, !0) } var i = new Error("Cannot find module '" + k + "'"); throw i.code = "MODULE_NOT_FOUND", i } var j = b[k] = { exports: {} }; g[k][0].call(j.exports, function(l) { var o = g[k][1][l]; return f(o ? o : l) }, j, j.exports, e, g, b, d) } return b[k].exports } var a = typeof require == "function" && require; for (var c = 0; c < d.length; c++) { f(d[c]) } return f })({ 1: [function(f, d, a) { var c = f("./get"); var b = new c(); var a = function() { var g = function() { this.width = 0; this.height = 0; this.rad1 = 0; this.rad2 = 0; this.x = 0; this.y = 0; this.z = 0; this.r = 0; this.obj }; g.prototype.init = function(i, j, k, h) { this.width = k; this.height = h; this.r = 5000; this.rad1 = i; this.rad2 = j; this.obj = new THREE.PerspectiveCamera(35, this.width / this.height, 1, 10000); this.setPosition(this.rad1, this.rad2, this.r) }; g.prototype.setPosition = function(i, j) { var h = b.pointSphere(i, j, this.r); this.obj.position.set(h[0], h[1], h[2]); this.obj.up.set(0, 1, 0); this.obj.lookAt({ x: 0, y: 0, z: 0 }) }; return g }; d.exports = a() }, { "./get": 3 }], 2: [function(c, b, a) { b.exports = function(g, f, d) { var h; g.addEventListener(f, function(i) { clearTimeout(h); h = setTimeout(function() { d(i) }, 500) }, false) } }, {}], 3: [function(c, b, a) { var a = function() { var d = function() {}; d.prototype.randomInt = function(g, f) { return Math.floor(Math.random() * (f - g)) + g }; d.prototype.degree = function(f) { return f / Math.PI * 180 }; d.prototype.radian = function(f) { return f * Math.PI / 180 }; d.prototype.pointSphere = function(g, h, f) { var i = Math.cos(g) * Math.cos(h) * f; var k = Math.cos(g) * Math.sin(h) * f; var j = Math.sin(g) * f; return [i, j, k] }; return d }; b.exports = a() }, {}], 4: [function(f, d, a) { var c = f("./get"); var b = new c(); var a = function() { var g = function() { this.rad1 = 0; this.rad2 = 0; this.x = 0; this.y = 0; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0