Re: Particle System

New Message Reply Date view Thread view Subject view Author view

Geoff Levner (g.levner++at++acsys.it)
Thu, 25 Nov 1999 18:41:58 +0100


Dimitris Christopoulos wrote:

> The problem is that my particles are represented as points, each
> particle has its own path
> and is independent of the others. In Opengl I just compute the new
> position of all the particles,
> do a loop through all particles and draw them as lines from the previous
> position to the current.
> Now how do I store this kind of dynamic data in a Geoset. I could modify
> at ech frame the
> coordinate values of a geoset directly but I dont know how efficient
> this would be for 4000 particles,
> which are displayed at each frame.

It sounds like what you probably want to do is to use a callback in the
DRAW process to draw your particles (using your old OpenGL code) rather
than creating a geoset. Try something like this:

    pfChannel *chan;
    chan->setTravFunc(PFTRAV_DRAW, drawfunc);

This tells Performer to call your own function to draw the channel, rather
than doing it itself. Then you supply a draw callback which looks
something like this:

    void drawfunc(pfChannel *chan, void *userdata)
    {
        chan->clear();
        pfDraw();
        // OpenGL code to draw particles...
    }

Look at the man page for pfChannel ("application-defined callbacks") for
more info.

Geoff

--
Geoff Levner -- g.levner++at++acsys.it
ACS Studio, via Aurelia 58, 00165 Roma, Italy
tel. +39-063936331, fax +39-0639363317

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Nov 25 1999 - 09:33:16 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.