/*! 2018-07-13 */
function init(){oss=[],targets={table:[],torus:[],sphere:[],helix:[],grid:[]},camera=new THREE.PerspectiveCamera(40,window.innerWidth/window.innerHeight,1,1e5),camera.position.z=2800,scene=new THREE.Scene,tableLine_odd=new THREE.Scene,tableLine_even=new THREE.Scene;for(var a=0;a<table.length;a++){var b=document.createElement("div");b.className="element";var c=document.createElement("img");c.src=table[a].src,c.setAttribute("bowtie",""),c.setAttribute("company",""),c.setAttribute("name",table[a].nickname),c.setAttribute("text",""),c.setAttribute("imgId",""),b.appendChild(c);var d=new THREE.CSS3DObject(b);d.position.x=4e3*Math.random()-2e3,d.position.y=4e3*Math.random()-2e3,d.position.z=4e3*Math.random()-2e3,scene.add(d),oss.push(d);var d=new THREE.Object3D;d.position.z=-3e4,targets.table.push(d)}for(var e=new THREE.Vector3,a=0,f=oss.length;a<f;a++){if(0==a)var g=1.025*Math.acos(2*a/f-1),h=Math.sqrt(f*Math.PI)*g*1.01;else var g=Math.acos(2*a/f-1),h=Math.sqrt(f*Math.PI)*g;var d=new THREE.Object3D;d.position.x=750*Math.cos(h)*Math.sin(g),d.position.y=750*Math.sin(h)*Math.sin(g),d.position.z=750*Math.cos(g),e.copy(d.position).multiplyScalar(2),d.lookAt(e),targets.sphere.push(d)}for(var e=new THREE.Vector3,a=0,f=oss.length;a<f;a++){var d=new THREE.Object3D;d.position.x=a%5*600-800,d.position.y=-Math.floor(a/5)%5*400+800,d.position.z=200-60*a*1.5,d.rotation.z=.03*-a,d.lookAt(e),targets.torus.push(d)}for(var e=new THREE.Vector3,a=0,f=oss.length;a<f;a++){var d=new THREE.Object3D;d.position.x=a%5*600-1200,d.position.y=-Math.floor(a/5)%5*400+800,d.position.z=200-60*a*1.5,d.rotation.z=.03*-a,e.x=d.position.x,e.y=d.position.y,e.z=d.position.z,d.lookAt(e),targets.grid.push(d)}for(var e=new THREE.Vector3,a=0,f=oss.length;a<f;a++){var g=.175*a+Math.PI,d=new THREE.Object3D;d.position.x=900*Math.sin(g),d.position.y=-8*a+450,d.position.z=900*Math.cos(g),e.x=d.position.x,e.y=d.position.y,e.z=d.position.z,d.lookAt(e),targets.helix.push(d)}renderer=new THREE.CSS3DRenderer,renderer.setSize(window.innerWidth,window.innerHeight),renderer.domElement.style.position="absolute",renderer.domElement.className="abc",document.getElementById("container").appendChild(renderer.domElement),window.addEventListener("resize",onWindowResize,!1)}function transform(a,b,c,d){TWEEN.removeAll(),scene_init(),animate_start=0;for(var e=0;e<oss.length;e++){var f=oss[e],g=a[e];new TWEEN.Tween(f.position).to({x:g.position.x,y:g.position.y,z:g.position.z},b).easing(TWEEN.Easing.Exponential.InOut).start(),"table"==c?$("div").remove(".element"):"torus"==c?new TWEEN.Tween(f.position).to({x:g.position.x,y:g.position.y,z:-3e5},1e3*Math.random()+3e3).delay(1e3*Math.random()+2e4).start():"sphere"==c?new TWEEN.Tween(f.position).to({y:-5e3},1e3*Math.random()+3e3).delay(1e3*Math.random()+19500).start():"grid"==c?new TWEEN.Tween(f.position).to({x:g.position.x,y:g.position.y,z:g.position.z},1e3).delay(195e3).start():"helix"==c&&new TWEEN.Tween(f.position).to({y:3e3,z:g.position.z},1e3*Math.random()+2e3).delay(1e3*Math.random()+18500).start(),new TWEEN.Tween(f.rotation).to({x:g.rotation.x,y:g.rotation.y,z:g.rotation.z},Math.random()*b+b).easing(TWEEN.Easing.Exponential.InOut).start()}new TWEEN.Tween(this).to({},1e6).onUpdate(function(){render(c)}).start()}function onWindowResize(){camera.aspect=window.innerWidth/window.innerHeight,camera.updateProjectionMatrix(),renderer.setSize(window.innerWidth,window.innerHeight),render()}function animate(){runninganimate=window.requestAnimationFrame(animate),TWEEN.update(),runanimate++}function resetanimate(){window.cancelAnimationFrame(runninganimate)}function scene_init(){scene.position.x=0,scene.position.y=0,scene.position.z=0,scene.rotation.x=0,scene.rotation.y=0,scene.rotation.z=0}function update(){for(var a=0;a<oss.length;a++){var b=oss[a];b.position.z+=20,b.rotation.z+=1*a/1e3,b.position.z>800&&(b.position.z=200-60*(oss.length-1)*1.5)}}function update2(){for(var a=0;a<oss.length;a++){var b=oss[a];b.position.z+=180,b.position.z>800&&(b.position.z=200-60*(oss.length-1)*1.5)}}function render(a){"torus"==a&&(animate_start+=1,scene.rotation.z+=.05,animate_start>300&&update()),"grid"==a&&update2(),"sphere"==a&&(animate_start+=1,animate_start>900?scene.position.z>0&&(scene.rotation.y+=.005,scene.position.z-=5):animate_start>650?(scene.rotation.y+=.001,scene.position.z=scene.position.z):animate_start>400?(scene.rotation.y+=.003,scene.position.z+=5):scene.rotation.y+=.005),"helix"==a&&(animate_start+=1,scene.rotation.y-=.02,animate_start>600?scene.position.z>0&&(scene.position.z-=7):animate_start>300?scene.position.z=scene.position.z:animate_start>150&&(scene.position.z+=7)),renderer.render(scene,camera)}var camera,scene,renderer,controls;window.WBActivity.resize=function(){},window.WBActivity.start=function(){$("#wallCont").show()};var oss=[],targets={table:[],torus:[],sphere:[],helix:[],grid:[]},style="table",rotationY_add=0,animate_start=0,runanimate=0,runninganimate;