Skip to content

'disk' emitter, radiusSpread, angles#8

Merged
squarefeet merged 1 commit intosquarefeet:masterfrom
stemkoski:patch-1
Sep 6, 2013
Merged

'disk' emitter, radiusSpread, angles#8
squarefeet merged 1 commit intosquarefeet:masterfrom
stemkoski:patch-1

Conversation

@stemkoski
Copy link
Contributor

  • Included disk-shaped emitter
  • now able to randomize radius size for sphere/disk emitter
  • particles can have an angle, angle can be randomized or aligned to velocity direction
  • fixed _resetParticle velocity direction issue
  • TODO: incorporate angleVelocity for rotating particles

* Included disk-shaped emitter
* now able to randomize radius size for sphere/disk emitter
* particles can have an angle, angle can be randomized or aligned to velocity direction
* fixed _resetParticle velocity direction issue
* TODO: incorporate angleVelocity for rotating particles
@stemkoski
Copy link
Contributor Author

The pull requests #8 and #9 go hand-in-hand, one is for the particle emitter and the other for the group. Try testing it out with the following test case:

// Create a particle group to add the emitter
this.particleGroup = new ShaderParticleGroup(
{
    texture: THREE.ImageUtils.loadTexture('images/laserWhiteSmall.png'),
    maxAge: 1,
    colorize: 1,
    blending: THREE.NormalBlending,
});

// Create a single emitter
var particleEmitter = new ShaderParticleEmitter(
{
    type: 'disk',
    position: new THREE.Vector3(0, 100, 0),
    radius: 20,
    radiusSpread: 40,
    speed: 50,
    speedSpread: 10,
    colorStart: new THREE.Color('yellow'),
    colorEnd: new THREE.Color('red'),
    opacityStart: 1,
    opacityMiddle: 1,
    opacityEnd: 0,
    size: 20,
    sizeEnd: 20,
    angle: 0,
    // angleSpread: 2 * Math.PI, // use for random direction
    angleAlignVelocity : true,
    particlesPerSecond: 1000,
    emitterDuration: 5 // null = infinite duration
});

// Add the emitter to the group.
particleGroup.addEmitter( particleEmitter );

// Add the particle group to the scene so it can be drawn.
scene.add( particleGroup.mesh );

With the image included below:
laserwhitesmall

and you should get something resembling the following:

kaboom

squarefeet added a commit that referenced this pull request Sep 6, 2013
'disk' emitter, radiusSpread, angles
@squarefeet squarefeet merged commit 9a633ca into squarefeet:master Sep 6, 2013
squarefeet added a commit that referenced this pull request Sep 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants