iDevGames Forums
Turn a Quad into particles - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Turn a Quad into particles (/thread-5911.html)



Turn a Quad into particles - MACnus - Feb 3, 2005 03:40 AM

I have a Quad with a texture on.
Is it possible to turn that quad into particles with the texure still attached,
The effect is to make a wall turn into particles(sand) and fall down.

tnx


Turn a Quad into particles - TomorrowPlusX - Feb 3, 2005 05:23 AM

You would have to switch out the single quad with a fairly highly tesselated set of billboarded quads. If I were doing it, the approach I'd take is, say, that if the wall were three dimensional, as opposed to just a single 2d quad ( e.g., like a flattened cube ) I'd *fill* it with particles, turn off the wall, and let the particles fall.


Turn a Quad into particles - skyhawk - Feb 3, 2005 11:19 AM

maybe he wants a more realistic look? Wink


Turn a Quad into particles - TomorrowPlusX - Feb 3, 2005 11:43 AM

skyhawk Wrote:maybe he wants a more realistic look? Wink

Good luck, then Wink

Uh... putting on thinking cap... perhaps instead of individual particles, you'd instead massively tesselate the wall, and treat each junction like a point in a verlet integrated system? You'd probably get "jello", but with tuning and damping it might be cool.


Turn a Quad into particles - BinarySpike - Feb 3, 2005 12:06 PM

TomorrowPlusX Wrote:I'd *fill* it with particles, turn off the wall, and let the particles fall.

It matters what he wants to do...

(a) make the particles fall from the top...
Kinda like a dust/fall off effect...

(b) make the particles "Slide" from the bottom...
Kinda like a sand effect...

Instead of turning off the wall "cut" the wall where you want it and let
it fall/slide where the wall isn't....

But, this would mean a quad *and* a tesselated particles...


Turn a Quad into particles - MACnus - Feb 4, 2005 02:31 AM

thanks for the suggestions, i will try it out soon.

I will post the final code if you are interested.


Turn a Quad into particles - kberg - Feb 4, 2005 02:35 AM

If you're going for a somewhat cinematic effect, I'd probably start with my wall texture, and then blend that into a disintegrated texture which somewhat resembles your particle system; that might produce a nice lead-in to the effect. Textured billboarded quads, or point-sprites on an nvidia card would probably work the best for the particles themselves.


Turn a Quad into particles - MACnus - Feb 6, 2005 07:59 AM

I made it work!

one question, if i have more than 1500 particles, it draws very slow

is there a way to avoid this.

I'm using a for loop in my drawFrame

for(loop=0; loop < MAX_PARTICLES; loop++)

tnx


Turn a Quad into particles - Puzzler183 - Feb 6, 2005 08:23 AM

If you are using immediate mode, switch to vertex arrays (and then vertex buffer objects) for this since it's dynamic.


Turn a Quad into particles - MACnus - Feb 6, 2005 08:57 AM

Do you mean something like this:
Code:
typedef struct
{
   float pos[3];
   BOOL active;
   float color[3];
   float dir[3];
   float life;
   float grav[3];
   float fade;
} Particles;
?


Turn a Quad into particles - Duane - Feb 6, 2005 09:10 AM

probably nothing to do with this, but turn it into a:

Code:
typedef struct
{
   float pos[3];
   BOOL active;
   float color[4];
   float dir[3];
   float life;
   float grav[3];
} Particles;

when you would normally look at fade, instead look at color[3], which would be transparency.