Toggle navigation
Sign Up
Log In
Explore
Works
Folders
Tools
Collections
Artists
Groups
Groups
Topics
Tasks
Tasks
Jobs
Teams
Jobs
Recommendation
More Effects...
JS
var ww = window.innerWidth, wh = window.innerHeight; var renderer = new THREE.WebGLRenderer({ canvas: document.querySelector("canvas") }); renderer.setSize(ww, wh); renderer.setClearColor(0xffffff); var scene = new THREE.Scene(); scene.fog = new THREE.Fog(0xffffff, 40, 70); var camera = new THREE.PerspectiveCamera(45, ww/wh, 1, 100); var ambient = new THREE.AmbientLight( 0xffffff,0.5 ); scene.add( ambient ); var light = new THREE.PointLight( 0xffffff, 3, 200 ); scene.add(light); var mouse = new THREE.Vector2(0.3,0.3); window.addEventListener("mousemove", function(e){ mouse.y = (1 - e.clientY / wh)*0.5; }); window.addEventListener("resize", function() { ww = window.innerWidth; wh = window.innerHeight; camera.aspect = ww / wh; camera.updateProjectionMatrix(); renderer.setSize(ww, wh); }); var curve, camera2, helper; function createTube(){ var points = []; var rings = 400; for(var i=0;i
=1){ progress = 0; } interval = mouse.y*0.001; var p1 = curve.getPointAt(progress); var p2 = curve.getPointAt(progress + interval); camera.position.set(p1.x,p1.y,p1.z); camera.lookAt(p2); if(progress+0.04 < 1){ var p3 = curve.getPointAt(progress + 0.04); light.position.set(p3.x,p3.y,p3.z); } progress += interval; camera.rotation.z = rotate; rotate+=(interval*50); renderer.render(scene, camera); } createTube(); requestAnimationFrame(render);
CSS
body{ overflow: hidden; margin: 0; }
HTML
Join Effecthub.com
Working with Global Gaming Artists and Developers!
Login
Sign Up
Or Login with Your Email Address:
Email
Password
Remember
Or Sign Up with Your Email Address:
Your Email
This field must contain a valid email
Set Password
Password should be at least 1 character
Stay informed via email