Marc,

Coincidentally I've been working on a particle system over a couple of snowy
days.

I will distribute the source code once I get it in a decent state and post
it to www.j3d.org (with some docs, Justin!). At the moment I'm using a
single Shape3D with byref geometry and performance is pretty good with
10,000 particles. I haven't done too much optimization yet.

So far I have a simple PointArray working with gravity, and a wind effect. I
plan to (atleast) add simple planar collisions and textured particles. I've
designed the code to be pretty pluggable, so multiple particle movement
(physics) systems can be in effect and interact.

Any other suggestions are more than welcome. One idea that I am toying with
is the ability to dynamically spawn new particles systems on a collision
(missile system collides with wall, spawns explosion system at point of
collision).

I've attached a screen-shot showing particles being emitted from the left of
the image with wind (up) and gravity (down) in effect. A still doesn't
really do it justice... ;-)

Sincerely,

Daniel Selman

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Marc Palmer
Sent: Monday, December 31, 2001 3:01 PM
To: [EMAIL PROTECTED]
Subject: Re: Best way to deal with many "duplicate" objects such as
particles?


> The byref is only slower if you are not updating it every frame.  We are
> using float[] by ref.  That means you can update the floats right in the
> array and then the floats are streamed over every frame.  There is no
> additional copies made.  Think of it this way, when you set the
attributes
> to allow you to update the geometry, Java3d will not use a display list,
so
> its sendnig the data every frame anyway.  If you use anything other than
> byref float[] then Java3d keeps its own internal copy, so every time you
> make an update it has to move stuff around.  By using byref float[] you
can
> basically work right with the data.

Hmmm, but surely this requires more processing?

With a single setTextureCoords (or whatever) call you supply the whole
array of texture points. With the byref mechanism, it has to look all of
these up to produce a final array doesn't it, or does all common hardware
support byref too so it just sends the refs array and also the points
array?

Yours, in ignorance.

=========================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

<<attachment: particles.jpg>>

Reply via email to