b0VIM 8.0sZA/angus17Anguss-MacBook-Pro.local~angus17/Dropbox/MAMP_htdocs/ccl_UCSC/courses/cmpm163/code/week4/w4_7_particleSystem.html 3210#"! Utp0ad#zjQ?*  x E D : "  r q ] \ V U   4 h g 4    yV:% w^MGF@? S(\&eF)G#"g renderer.setSize( window.innerWidth, window.in renderer.se renderer.setSize( window.in renderer.setSize( w r renderer.setSize( window.innerWidth, window.innerHeight ); camera.updateProjectionMatrix(); camera.aspect = window.innerWidth / window.innerHeight; function onWindowResize() { } window.addEventListener( 'resize', onWindowResize, false ); controls.dynamicDampingFactor = 0.3; controls.panSpeed = 1; controls.zoomSpeed = 2.2; controls.rotateSpeed = 5.0; controls = new THREE.TrackballControls( camera, renderer.domElement ); // container.appendChild( renderer.domElement ); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.setPixelRatio( window.devicePixelRatio ); renderer = new THREE.WebGLRenderer(); // // gui.add( spawnerOptions, "timeScale", -1, 1 ); gui.add( spawnerOptions, "spawnRate", 10, 30000 ); gui.add( options, "turbulence", 0, 1 ); gui.add( options, "lifetime", .1, 10 ); gui.add( options, "colorRandomness", 0, 1 ); gui.add( options, "sizeRandomness", 0, 25 ); gui.add( options, "size", 1, 20 ); gui.add( options, "positionRandomness", 0, 3 ); gui.add( options, "velocityRandomness", 0, 3 ); // }; timeScale: 1 verticalSpeed: 1.33, horizontalSpeed: 1.5, spawnRate: 15000, spawnerOptions = { }; sizeRandomness: 1 size: 5, lifetime: 2, turbulence: .5, colorRandomness: .2, color: 0xaa88ff, velocityRandomness: .5, velocity: new THREE.Vector3(), positionRandomness: .3, position: new THREE.Vector3(), options = { // options passed during each spawned scene.add( particleSystem ); } ); maxParticles: 250000 particleSystem = new THREE.GPUParticleSystem( { // system for your whole scene // relative to the position of the particle system, but you will probably only need one // as you would any other scene graph component. Particle positions will be // The GPU Particle system extends THREE.Object3D, and so you can use it scene = new THREE.Scene(); camera.position.z = 100; camera = new THREE.PerspectiveCamera( 28, window.innerWidth / window.innerHeight, 1, 10000 ); container = document.getElementById( 'container' ); // function init() { animate(); init(); options, spawnerOptions, particleSystem; controls, container, gui = new dat.GUI( { width: 350 } ), scene, renderer, clock = new THREE.Clock(), var camera, tick = 0, --> three.js - GPU particle system plugin by Charlie Hoey.