title: Snowfall Canvas, Change Particle Speed
body: <p>I'm trying to change the particle speed of this snowfall script but I can't seem to find the numbers that represent "Falling Speed". Right now the particles are falling too fast, here's the bulk of the script:</p>
  
  <pre><code>var SCREEN_WIDTH = window.innerWidth;
              var SCREEN_HEIGHT = window.innerHeight;
  
              var container;
  
              var particle;
  
              var camera;
              var scene;
              var renderer;
  
              var mouseX = 0;
              var mouseY = 0;
  
              var windowHalfX = window.innerWidth / 2;
              var windowHalfY = window.innerHeight / 2;
  
              var particles = []; 
              var imgArr = new Array();
  
  
              function init() {
  
                  container = document.createElement('div');
                  document.body.appendChild(container);
  
                  camera = new THREE.PerspectiveCamera( 75, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
                  camera.position.z = 1000;
  
                  scene = new THREE.Scene();
  
                  renderer = new THREE.CanvasRenderer();
                  renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
  
                  for (var i = 0; i &lt; 1000; i++) {
                      var particleImage = new Image();
                      particleImage.src = imgArr[Math.round(Math.random()*(imgArr.length-1))];
                      var material = new THREE.ParticleBasicMaterial( { map: new THREE.Texture(particleImage) } );
                      particle = new Particle3D( material);
                      particle.position.x = Math.random() * 2000 - 1000;
                      particle.position.y = Math.random() * 2000 - 1000;
                      particle.position.z = Math.random() * 2000 - 1000;
                      particle.scale.x = particle.scale.y =  0.8;
                      scene.add( particle );
  
                      particles.push(particle); 
                  }
  
                  container.appendChild( renderer.domElement );
  
                  setInterval( loop, 1000 / 60 );
  
              }
  
              function loop() {
  
              for(var i = 0; i&lt;particles.length; i++)
                  {
  
                      var particle = particles[i]; 
                      particle.updatePhysics(); 
  
                      with(particle.position)
                      {
                          if(y&lt;-1000) y+=2000; 
                          if(x&gt;1000) x-=2000; 
                          else if(x&lt;-1000) x+=2000; 
                          if(z&gt;1000) z-=2000; 
                          else if(z&lt;-1000) z+=2000; 
                      }               
                  }
  
                  renderer.render( scene, camera );
  
  
              }
  </code></pre>
  
  <p>It's using Three.js as a backbone. Here's the original script to see it in action:</p>
  
  <p><a href="https://github.com/sebleedelisle/live-coding-presentations/tree/master/2011/JSSnow" rel="nofollow noreferrer">https://github.com/sebleedelisle/live-coding-presentations/tree/master/2011/JSSnow</a></p>