update = {
var mouseX = 0, mouseY = 0;
var clock = new THREE.Clock();
document.onmousemove = function(event) {
mouseX = ( event.clientX - (width / 2) ) * 10;
mouseY = ( event.clientY - (height / 2) ) * 10;
};
return function update() {
camera.position.x += ( 0.125 * mouseX - camera.position.x ) * .0125;
camera.position.y += ( - 0.125 * mouseY - camera.position.y ) * .0125;
camera.lookAt( scene.position );
var delta = clock.getDelta();
for ( var i = 0; i < maxPasta; i ++ ) {
var mesh = pastaPile.meshes[ i ];
mesh.rotation.x += spinSpeed * 0.8 * delta;
mesh.rotation.y += spinSpeed * delta;
mesh.position.y = ( mesh.position.y - 150 * delta ) % 8000;
}
}
}