Creating a particle display

Hey gurus,

Fogaudio-not-so-guru here. Just wondering if anyone has ever coded up a particle display before. I am thinking the best way for me to do this is to create a bunch of 2D blending polygons. The issue I have, though is that I have a static field of “particles” but I want to be able to fly around the field and look at it at different angles. What I was thinking of doing was running the coordinates of the particles through the model and projection matrices (but not actually rendering these coordinates - just saving them). Then I want to create little polygons (square or triangle) centered around these new “projected” points (using the z-domain as a scaling function to the polygon). So each of the original vertices would transform to say three vertices for the triangle case and then I would render them with the appropriate alpha-blending and (this time with the projection matrix disabled, since it effectively has already happened). Anyone ever try anything like this succesfully?

Also instead of sorting the objects with say a bsp I was experimenting with drawing the objects in order of their alpha-channel (can’t remember if most opaque came first or last). But this seemed to work ok??? Or am I just seeing things.

TIA,
Ryan (fogaudio)

Oh I forgot to mention the whole point of doing the extra step through the model and projection matrices was so that I could then form polygons (particles) which are always “normaled” to the screen. Maybe this was obvious but JIC.

Thanks again,
Any help/comments will be really appreciated,
Ryan

I think that dealing with the rotation in the modelview matrix is enough. WHat are you doing with the proj?

Then you do the billboarding (look it up, it’s very simple to do), and for sorting, it depends on what type you do. source alpha and one minus source alpha needs back to from for all transparent polys.

V-man

Thanks VMAN,

I will check out billboarding. I am writing some code for my workplace which draws a three-dimensional field. This field will be made of particles which are detected and updated on some large interval (in 10’s of seconds maybe). This field sits within a space which has landscape data and the data’s position itself is relevant.

So I guess what I am trying to do is to make a volumetric or particle display which has the smallest number of vertices. The thing is that I don’t have a gridded field. Although originally these particles would be detected in a grid most of them will be ignored when drawing the pseudo-volumetric display. This is why I am not calling it a volumetric display or a 3D image. I guess this might also be called fully-parametric???

I did a quick look on billboarding and found a lot of stuff on drawing textured-mapped trees which stay normal to the perspective and that is perfect!

Thanks again,
Ryan

[This message has been edited by FogAudio (edited 09-24-2002).]