Detailed explanation of particles effects with all of its math formula

Page 1 of 1

3 Replies - 549 Views - Last Post: 31 December 2013 - 07:58 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=337341&amp;s=8b2286430b2b3a7f805e3d0f78888166&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 dreaminxna

Reputation: 3
• Posts: 70
• Joined: 10-June 13

Detailed explanation of particles effects with all of its math formula

Posted 28 December 2013 - 11:28 PM

Hi. Im having a hard time understanding some math behind particle effects especially the explosion thing. I really dont know how the explosion is generated. I wonder if its a random direction or it does use a math formula which i dont know. So im asking if does anyone knows a very well detailed explanation of this that is for beginner. Ive been searching the net but most of them use an engine or a c++. I really looking for java because i am much comfortable with that.

Thanks

Is This A Good Question/Topic? 0

Replies To: Detailed explanation of particles effects with all of its math formula

#2 carnivroar

• D.I.C Regular

Reputation: 29
• Posts: 387
• Joined: 18-September 11

Re: Detailed explanation of particles effects with all of its math formula

Posted 29 December 2013 - 02:04 PM

This is how I do my explosions. In this case I'm using a Sphere3d object, but you can use anything. I use this for creating little splashes such as when a raindrop hits the ground, or for blood when something gets shot, and basically anything involving droplets.

I use spherical coordinates to generate a velocity vector in random directions.

```
public LinkedList<Sphere3d> createExplosion(Vector3d position, Vector3d velocity, double outwardSpeed, int count, double radius) {
for (int i = 0; i < count; i++) {
Vector3d.getRandomUnitVector().mulLocal(outwardSpeed).addLocal(velocity), // <- the velocity of the Sphere3d
}
return list;
}

.
.
.
.

public class Vector3d {

// code removed for brevity

public static final Vector3d getRandomUnitVector() {
return getRandomUnitVector(MathConsts.PI, MathConsts.TWO_PI);
}

public static final Vector3d getRandomUnitVector(double thetaRange, double phiRange) {
return fromSpherical(1, RandLookUp.nextDouble(thetaRange), RandLookUp.nextDouble(phiRange));
}

public static Vector3d fromSpherical(double r, double theta, double phi) {
return new Vector3d(r * Math.sin(theta) * Math.cos(phi),
r * Math.sin(theta) * Math.sin(phi),
r * Math.cos(theta));
}
}

```

This post has been edited by carnivroar: 29 December 2013 - 02:16 PM

#3 aaron1178

• Dovakiin, Dragonborn

Reputation: 169
• Posts: 1,306
• Joined: 22-October 08

Re: Detailed explanation of particles effects with all of its math formula

Posted 29 December 2013 - 09:00 PM

I've found some good articles on Particles which include some math formulas.

Applied Mathematics and Scientiﬁc Computing in the Visual Eﬀects Industry

Smoothed-particle hydrodynamics

Particle system

Particles tutorial part1 - get something on the Screen

Particle System - Step by Step

Chapter 4. Particle Systems In Detail

These are just a few articles out of thousands available on the internet. I hope this helps in your understanding of particle effects and particle systems.

#4 dreaminxna

Reputation: 3
• Posts: 70
• Joined: 10-June 13

Re: Detailed explanation of particles effects with all of its math formula

Posted 31 December 2013 - 07:58 AM

aaron1178, on 29 December 2013 - 09:00 PM, said:

I've found some good articles on Particles which include some math formulas.

Applied Mathematics and Scientiﬁc Computing in the Visual Eﬀects Industry

Smoothed-particle hydrodynamics

Particle system

Particles tutorial part1 - get something on the Screen

Particle System - Step by Step

Chapter 4. Particle Systems In Detail

These are just a few articles out of thousands available on the internet. I hope this helps in your understanding of particle effects and particle systems.

Wow Cool.. Thank you very much for the links