Vizard 8 » Reference » 3D models » Particle systems » Particle systems basics
8.1

Particle System Basics

Vizard supports particle systems, a computer graphics technique used to simulate dynamic natural phenomena such as smoke, fire, or clouds. Use the .osg (open scene graph) format for particle systems.

Adding a particle system

When you add a particle system, inform Vizard that the model has particles with <node3d>.hasparticles. If the particle system emits particles, signal the emitting with  <node3d>.enable(viz.EMITTERS).

fire = viz.add('fire.osg',pos=[0,1.8,2])
fire.hasparticles()

Changing particle system parameters

The .osg file is an OpenSceneGraph description. It's just text, like a python script or an html web page, so if you drag it into the Vizard editor, you can see its contents and make changes to control the effect. An alternative to manually editing in a Vizard or a simple text editor is to use OSGEdit. Once you see the contents of the .osg file, you'll notice that it's about a page and a half of parameters. The values found here determine factors such as the appearance, the lifetime, and the generation behavior of each particle, as well as the direction and rate at which the emitter should create new particles. The table below lists some of the parameters that you might like to change.

OSG parameters

Parameter

Description

lifetime

This controls how long a single particle will exist before it disappears.

sizeRange

Two numbers that control the beginning and ending size of the particles. The particles will grow to the ending size during its lifetime.

alphaRange

The beginning and ending alpha value of the particles. For example, 1 0, means that the particle will start out opaque and end up transparent.

colorRange

The beginning and ending color of the particles.

rateRange

A min and max range of how many particles to create per second.

initialSpeedRange

A min and max range of how fast the particles initial speed should be.

See also

In this section:

Particle systems command table

Other sections:

3D model transform basics

3D model transforms command table

Appearance and texturing basics

Creating 3D models on-the-fly-- the basics

Example scripts: