3 Replies - 351 Views - Last Post: 31 December 2013 - 07:58 AM Rate Topic: -----

#1 dreaminxna  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • 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 :D

Advance happy new year :D

Is This A Good Question/Topic? 0
  • +

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

#2 carnivroar  Icon User is offline

  • D.I.C Regular

Reputation: 28
  • View blog
  • Posts: 382
  • 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) {
  LinkedList<Sphere3d> list = new LinkedList<Sphere3d>();
  for (int i = 0; i < count; i++) { 
    list.add(new Sphere3d(position, 
                          Vector3d.getRandomUnitVector().mulLocal(outwardSpeed).addLocal(velocity), // <- the velocity of the Sphere3d
                          radius));
  }
  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

Was This Post Helpful? 0
  • +
  • -

#3 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • 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 Scientific Computing in the Visual Effects 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.
Was This Post Helpful? 1
  • +
  • -

#4 dreaminxna  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 10-June 13

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

Posted 31 December 2013 - 07:58 AM

View Postaaron1178, on 29 December 2013 - 09:00 PM, said:

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

Applied Mathematics and Scientific Computing in the Visual Effects 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 :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1