Skip to main content
gamedev.net
🔒 Locked

Particle Tutorial/Explanations.

Started by snoddas14 Mar 28, 2007 at 12:20 PM 6 replies 750+ views
Original Post
snoddas14
snoddas14
hi! i an now reading on Particle systems, and i need an good tutorial online plus a good explenations for you/the tutorial, i want it to be easy understood and easy to use! if you got one of those sites, pleas tell me! or you could explain it all here in the forum! Cheers!
LackOfGrace
LackOfGrace
Well, creating a basic particle engine isnt that hard.
what do you want your particles to do?
what performance do you need?
does your particle engine require scripted behaviors?

as always copy/past wont learn you anything, and if you cant think of the basic idea behind a partcile system you should start with something simpler.

i will however show point in the "right" direction.

to make a simple yet robust particle engine you would need the following classes

Paricle - Holds particle data (position,size,velocity)
Emitter - Emmits particles
System - Container for particles and emitters

just try to implement the basics, then restart from scratch and consider the faults you did with the first one.
snoddas14
snoddas14
well i thing is, i did that.
but i dident work.

and i gone use it for my canons on an pirate ship!

typedef struct{D3DXVECTOR3 Pos;D3DXVECTOR3 Vel;D3DCOLOR Color;bool Alive;} Effect;
Xrystal
Xrystal
As the scene progresses are you moving the various particles along the path you want them to travel?

In your case the cannon (emitter) needs to fire its balls (particles) and travel (distance) towards a target (direction).

Your scene, if I am understanding this rightly (someone please correct me if I am wrong), needs to update the distance and hence new position of the cannon ball before it decides if it hits or misses the target.
LackOfGrace
LackOfGrace
Quote:
Original post by snoddas14
well i thing is, i did that.
but i dident work.

and i gone use it for my canons on an pirate ship!

*** Source Snippet Removed ***


well, for a simple particle that struct is sufficient.
are you updating you particles?
what does your system do now?
are the particles getting correct values?

snoddas14
snoddas14
Well i dono how to update the particles, i read anout it in my bok, but i dident get any new information, atleast on how to redner them!

LackOfGrace
LackOfGrace
Loop through all the particles and update thier position (every frame)
with help from the velocity variable.

you could also recolor, resize, change velocity, play a sound, emitt particles from the particle and whatever you can think of in this update.
Stani R
Stani R
I've successfully built a simple particle system using this tutorial as a starting point. It goes over the implementation as well as usage of such a system.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.