three.js - conflict with particles

three.js - conflict with particles

Hi,

I have a problem with three.js. i have two particle system set ups that seem to be conflicting with each other.

The first scene loads up without problem, but when the second set loads the first set of particles vanish. This wouldn't be too confusing if it weren't for the the fact that the rest of the first scene is still appearing in the entire set up.

Is there an easy way to rename or call in the two sets of particles?

I've looked around but can't find a ref to this.

the one thing that i think might be causing this is the PARTICLE_COUNT call - which features in both scripts...

in one it is
  1. var PARTICLE_COUNT = 15000;
    var MAX_DISTANCE = 1500;
    var IMAGE_SCALE = 5;

followed by

  1. for(var i = 0; i < PARTICLE_COUNT; i++) {
            geometry.vertices.push(new THREE.Vertex());
            var star = new Star();
            stars.push(star);
        }

and the second

  1.     AUDIO_FILE        = 'songs/zircon_devils_spirit',
        PARTICLE_COUNT    = 250,
        MAX_PARTICLE_SIZE = 12,
        MIN_PARTICLE_SIZE = 2,
        GROWTH_RATE       = 5,
        DECAY_RATE        = 0.5,

        BEAM_RATE         = 0.5,
        BEAM_COUNT        = 20,

        GROWTH_VECTOR = new THREE.Vector3( GROWTH_RATE, GROWTH_RATE, GROWTH_RATE ),
        DECAY_VECTOR  = new THREE.Vector3( DECAY_RATE, DECAY_RATE, DECAY_RATE ),
        beamGroup     = new THREE.Object3D(),
        particles     = group.children,
        colors        = [ 0xaaee22, 0x04dbe5, 0xff0077, 0xffb412, 0xf6c83d ],
        t, dancer, kick;


followed by

  1. dancer = new Dancer();
      kick = dancer.createKick({
        onKick: function () {
          var i;
          if ( particles[ 0 ].scale.x > MAX_PARTICLE_SIZE ) {
            decay();
          } else {
            for ( i = PARTICLE_COUNT; i--; ) {
              particles[ i ].scale.addSelf( GROWTH_VECTOR );
            }
          }
          if ( !beamGroup.children[ 0 ].visible ) {
            for ( i = BEAM_COUNT; i--; ) {
              beamGroup.children[ i ].visible = true;
            }
          }
        },
        offKick: decay
      });

      dancer.onceAt( 0, function () {
        kick.on();
      }).onceAt( 8.2, function () {
        scene.add( beamGroup );
      }).after( 8.2, function () {
        beamGroup.rotation.x += BEAM_RATE;
        beamGroup.rotation.y += BEAM_RATE;
      }).onceAt( 50, function () {
        changeParticleMat( 'white' );
      }).onceAt( 66.5, function () {
        changeParticleMat( 'pink' );
      }).onceAt( 75, function () {
        changeParticleMat();
      }).fft( document.getElementById( 'fft' ) )
        .load({ src: AUDIO_FILE, codecs: [ 'ogg', 'mp3' ]})

      Dancer.isSupported() || loaded();
      !dancer.isLoaded() ? dancer.bind( 'loaded', loaded ) : loaded();

bit of a "needle lost in a haystack" i know...

but maybe someone can see the error of my ways!!!