This tutorial shows how to use mjbWorld to produce particle systems. For possible
uses of particle systems see
here.
Note: This implementation uses PointArray (with anti-aliased points). This
has the following advantages and disadvantages:
Advantages:
Disadvantages:
- All points are the same size, (we cannot make the points that are nearer
to the viewer larger than distant ones)
- There may be problems with inconsistent rendering on bad OpenGL implementations.
Make sure you are using the latest drivers for your graphics card.
I am planning to produce another type of Particle System Bean to use OrientedShape3Ds.
So that users can choose which method would best meet their needs. I am also
planning to allow multiple generatorBeans and attactorBeans under the particleArrayBean
to allow more complex effects.
First start the program (if you don't have a copy of the program go
here). Use the '+' button to open the 'add view', select 'particleArrayBean'
and add it to the tree view (by clicking on + in the add view or by dragging
it).

Select the particleArrayBean in the tree view, this will bring up its properties
in the properties view.
Also startup the 3D view by clicking its front view.

Now add the 'timeline view' so that we can control the animation.

Press 'play' to run the animation.
You can also use 'stop','rewind','pause' and the 'step' buttons in the timeline
window to control the animation.

The best way to understand the properties is to try different values and see
what effect this has in the 3D view.
The parameters that you can select and modify are:
- number - number of particles
- initialPosition - Allows you to vary the point at which the particles start.
If this is disabled then the particles will start out at (0,0,0).
- initialVelocity - Allows you to superimpose an overall velocity on the particles.
If this is zero or disabled then the direction of the particles will be be
random, so on average, they will expand in all directions equally, initialVelocity
allows you to superimpose a direction on that, for example, water spouting
out of a pipe.
- initialColour - This is the colour of the particles when they are generated.
- initialEnergy - This allows you to specify the average speed of the particles
(excluding initialVelocity). so a higher value will make the animation run
faster
- initialSize - Size of all particles, default is 1.
- spread - if this is zero (or disabled) then all particles will travel at
the same speed (as if they are all on the surface of an expanding sphere).
As the value is increased towards 1 then the speeds will become more random.
- finalColour - If set the particles will interpolate between the initialColour
and the finalColour.
- colourRate - This specifies the number of frames that it takes for the colour
to interpolate between the initialColour and the finalColour. For example
if this is set to 10 then the colour will gradually change over the first
10 frames, then it will remain at finalColour.
- Repeat - If set then, when a particle reaches radius then it will start
again from the initialPosition.
- Radius - This is the maximum radius that the particles can travel from the
initialPosition. When the particles reach radius they either stop, or continue
from the origin depending on the setting of 'repeat'.

When you are happy with the animation, you can either save it as a .WRL file,
which can only be used by this program, or you could export it to Java3d source,
so that you could produce a stand alone java program.

|
metadata block
|
|
|
| see also: |
|
| Correspondence about this page |
|
|
Book Shop - Further reading.
Where I can, I have put links to Amazon for books that are relevant to
the subject, click on the appropriate country flag to get more details
of the book or to buy it from them.
|
|
|
Commercial Software Shop
Where I can, I have put links to Amazon for commercial software, not
directly related to this site, but related to the subject being discussed,
click on the appropriate country flag to get more details of the software
or to buy it from them.
|
|
|
Can you help?
Please send me any improvements to
here. I would appreciate ideas to make the pages more useful including
error correction, ideas for new pages, improvements to wording. It helps
if you quote the full URL of the page.
|
|
|
progam
I am working on a project which uses these principles, if you would like
to help me with this you are welcome to join in, here:
|
http://sourceforge.net/projects/mjbworld/
|
This site may have errors. Don't use for critical systems.