Jump to content
  • Advertisement
Sign in to follow this  
3Dgonewild

Particle editor

This topic is 3642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to create a simple particle editor , but i would like to ask a few questions first. 1) I don't quite understand how should i place the particles.Any ideas? Im using opengl btw... 2) What's the best way to calculate collision detection for a set of particles? Should i add a collision box which will be equal to the size of all particles OR should i check each particle one-by-one? That's all for now , thanks!

Share this post


Link to post
Share on other sites
Advertisement
This seems to be an interesting article on particle systems. I don't know if it addresses your questions, but you might find it useful anyway.

Share this post


Link to post
Share on other sites
Thanks for the link , but(to be honest) i don't really need it.
I can do many particle effects.

My main problem is how to place them so they can be re-translated on different position.

Anyway , i think after a long research i found out how to do it.
And im going to share it with everyone :) .

The editor will work like this:

___Options___
-[option] Number of active particles
-[option] Particle life
-[option] Texture type
-[option] Blending modes : ADD/SUB
-[option] Velocity min/max
-[option] start color & end color (fade in from colorA->colorB)
-[option] Spread min/max
-[option] Direction
-[option] Gravity min/max
-[option] Radial acceleration min/max
-[option] Alpha : start/end
-[option] Particle size
-[option] Bounding box




The particles will be saved like this:


loop through each particle and write:
Particle type , and the rest attributes
end




Then , on client you simply parse that file , and with the same code you can
render them anywhere on the screen.

So to answer my own question : Don't bother about the f<< position.
You only need the attributes of each particle.
Thanks anyway.

Share this post


Link to post
Share on other sites
A couple of notes on my particle system you might be interested in

Each particle has an initial position, direction, color, color "direction", lifetime, etc. To be able to configure this, I came up with a "Particle Property" class.

I store properties in the main particle system as a template for how to create new particles when they die. The particle property class has the following attributes:

* Constant - a constant value that is always applied
* Multiplier - something the end result is multiplied by
* Function - more on this in a second
* Parameter - parameter to the function.

The function is an enum of functions that can be called when creating the particle, ie


enum UeParticleFunction
{
PF_NONE = 0,
PF_RAND,
PF_SIN,
PF_COS
};



So you have a standard random number, Sine, Cosine and nothing. You can put more functions in as time goes by without breaking old particle systems. I have a function, UeParticleSystem::GetValue which will calculate a float value given a UeParticleProperty (using a simple switch statement for the function, doing the adds and multiplication, etc). You can even extend this even further to allow cooler movements to the particles (but I don't really need that).

This is the first time I've written a particle system that can be extended like this (the plan is to eventually have it scriptable) and it really works well for me because you don't have to go through and write massive amounts of code for special case emitters, just think for a few seconds about how to come up with the properties you'll need. That way you can set up in just a couple lines of code two completely different emitters. It's pretty cool.

Share this post


Link to post
Share on other sites
Quote:
1)
I don't quite understand how should i place the particles.Any ideas?
Im using opengl btw...



What do you mean how to place the particles? They should be getting automatically spewed out by your emitter, no?


Quote:

2)
What's the best way to calculate collision detection for a set of particles?
Should i add a collision box which will be equal to the size of all particles OR
should i check each particle one-by-one?


Is this particles colliding with one another, or the environment, or both? You may want to represent them as spheres for collision purposes (spheres are fast and simple to check collisions for). If they are of uniform size, all the better. You might also want to look at things called octrees if you have lots of particles.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!