public class SoParticleAnimation extends SoShape
A particle system is a set of particles (numParticles
) where each particle is defined by the following properties:
initialColor
, initialOpacity
, initialSize
,...) which defines the appearance of the particle at its birth.
endColor
, endOpacity
, endSize
,...) which defines the appearance of the particle just before its death.
lifeSpan
)
speed
)
dispersionAngles
) of the particle during its life span.
All of these properties may fluctuate randomly for each particle within a specified range of values (initialColorVariation
, initialOpacityVariation
, endColorVariation
, lifeSpanVariation
...).
Each particle emitted from a predefined shape (emitShapeType
) evolves from an initial appearance to a final appearance with a given speed and a life span in real time.
Billboard particles can be textured (particleFilename
, particleTexture
) to produce interesting realistic effects.
Like classical Open Inventor shapes, each particle is transformed by the current cumulative transformation and is drawn with the current lighting model and drawing style.
Classes derived from SoParticleAnimation
have default field values pre-set for conveniently generating specific effects. For example, SoParticleSmoke
has predefined field values for generating smoke effects.
Note: By default, particle animation uses transparency type ADD (see transparencyType
). Against a white background, particles will not be visible because with this transparency type, colors are added until full saturation is reached. Since white is already fully saturated, no additional visual effect is seen. In this case, use BLEND transparency type instead and change the particle texture from the default (a circular gradient that is gray in the middle and black on the edges) to one that is gray in the middle and white on the edges. For additional realism, you can add transparency to the texture, with zero transparency in the middle increasing linearly to full transparency on the edges.
File format/default:
ParticleAnimation {
numParticles | 1000 |
numParticlesVariation | 0.5 |
initialColor | 1 1 1 |
initialColorVariation | 0 0 0 |
initialOpacity | 0.8 |
initialOpacityVariation | 0.1 |
initialSize | 0.7 |
initialSizeVariation | 0.0 |
endColor | 0 0 0 |
endColorVariation | 0 0 0 |
endOpacity | 0.8 |
endOpacityVariation | 0.1 |
endSize | 0.01 |
endSizeVariation | 0.0 |
lifeSpan | 4000 |
lifeSpanVariation | 0.5 |
particleShape | BILLBOARD_SHAPE |
emitShapeType | POINT |
shapeScale | 1 1 1 |
dispersionAngles | 0.01 0.01 |
particleLife | CYCLIC_EMISSION |
speed | 1 |
speedVariation | 0.1 |
particleFilename | "" |
particleTexture | 32 32 ....(white circle on a black background texture ) |
goalFramesPerSecond | 0 |
transparencyType | ADD |
on | true |
See also:
SoFXViz
, SoParticleChemicalFlame
, SoParticleExplosion
, SoParticleFlame
, SoParticleLightRay
, SoParticleSmoke
, SoParticleSnow.Deprecated since Open Inventor 9400
No longer supported.
Modifier and Type | Class and Description |
---|---|
static class |
SoParticleAnimation.EmitShapeTypes
Deprecated.
Predefined shapes from which particles are emitted.
|
static class |
SoParticleAnimation.ParticleLifes
Deprecated.
Particle life.
|
static class |
SoParticleAnimation.ParticleShapes
Deprecated.
Particle shape type.
|
static class |
SoParticleAnimation.TransparencyTypes
Deprecated.
Type of transparency used by particle.
|
SoShape.ShapeTypes
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static int |
ADD
Deprecated.
Use
SoParticleAnimation.TransparencyTypes.ADD instead. |
static int |
BILLBOARD_SHAPE
Deprecated.
Use
SoParticleAnimation.ParticleShapes.BILLBOARD_SHAPE instead. |
static int |
BLEND
Deprecated.
Use
SoParticleAnimation.TransparencyTypes.BLEND instead. |
static int |
CIRCLE
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.CIRCLE instead. |
static int |
CYCLIC_EMISSION
Deprecated.
Use
SoParticleAnimation.ParticleLifes.CYCLIC_EMISSION instead. |
static int |
CYLINDER
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.CYLINDER instead. |
static int |
DISK
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.DISK instead. |
SoSFVec2f |
dispersionAngles
Deprecated.
Defines two angles (specified in radians) within which particles are randomly emitted.
|
SoSFEnum<SoParticleAnimation.EmitShapeTypes> |
emitShapeType
Deprecated.
Specifies a predefined shape from which particles are emitted.
|
SoSFColor |
endColor
Deprecated.
Final particle color.
|
SoSFVec3f |
endColorVariation
Deprecated.
Controls magnitude of random variation in the final particle color.
|
SoSFFloat |
endOpacity
Deprecated.
Final particle opacity: 0 = fully transparent, 1 = opaque.
|
SoSFFloat |
endOpacityVariation
Deprecated.
Controls magnitude of random variation in the final particle opacity.
|
SoSFFloat |
endSize
Deprecated.
Final particle size in world coordinates.
|
SoSFFloat |
endSizeVariation
Deprecated.
Controls magnitude of random variation in the final particle size.
|
static int |
GEOMETRY
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.GEOMETRY instead. |
SoSFFloat |
goalFramesPerSecond
Deprecated.
Indicates the goal number of frames per second for refreshing the particles.
|
static int |
INHERITED
Deprecated.
Use
SoParticleAnimation.TransparencyTypes.INHERITED instead. |
SoSFColor |
initialColor
Deprecated.
Initial particle color.
|
SoSFVec3f |
initialColorVariation
Deprecated.
Controls magnitude of random variation in the initial particle color.
|
SoSFFloat |
initialOpacity
Deprecated.
Initial particle opacity: 0 is fully transparent, 1 is opaque.
|
SoSFFloat |
initialOpacityVariation
Deprecated.
Controls magnitude of random variation in the initial particle opacity.
|
SoSFFloat |
initialSize
Deprecated.
Initial particle size in world coordinates.
|
SoSFFloat |
initialSizeVariation
Deprecated.
Controls magnitude of random variation in the initial particle size.
|
SoSFInt32 |
lifeSpan
Deprecated.
Particle life span in milliseconds.
|
SoSFFloat |
lifeSpanVariation
Deprecated.
Controls magnitude of random variation in the particle life span.
|
static int |
LINE
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.LINE instead. |
static int |
LINE_SHAPE
Deprecated.
Use
SoParticleAnimation.ParticleShapes.LINE_SHAPE instead. |
SoSFInt32 |
numParticles
Deprecated.
Number of emitted particles.
|
SoSFFloat |
numParticlesVariation
Deprecated.
Controls magnitude of random variation in the number of emitted particles.
|
SoSFBool |
on
Deprecated.
Activates/deactivates the particle system.
|
static int |
ONE_EMISSION
Deprecated.
Use
SoParticleAnimation.ParticleLifes.ONE_EMISSION instead. |
SoSFFilePathString |
particleFilename
Deprecated.
Specifies the name of the file containing the texture to be applied to the particles.
|
SoSFEnum<SoParticleAnimation.ParticleLifes> |
particleLife
Deprecated.
Specifies if particles are emitted one time (
SoParticleAnimation.ONE_EMISSION ) or cyclically (SoParticleAnimation.CYCLIC_EMISSION ). |
SoSFEnum<SoParticleAnimation.ParticleShapes> |
particleShape
Deprecated.
Specifies the shape of the particles.
|
SoSFImage |
particleTexture
Deprecated.
Specifies an in-memory texture used for particles.
|
static int |
POINT
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.POINT instead. |
static int |
POINT_SHAPE
Deprecated.
Use
SoParticleAnimation.ParticleShapes.POINT_SHAPE instead. |
SoSFVec3f |
shapeScale
Deprecated.
Specifies a nonuniform scale factor applied to the predefined shape from which particles are emitted.
|
SoSFFloat |
speed
Deprecated.
Specifies the particle speed in units per second.
|
SoSFFloat |
speedVariation
Deprecated.
Controls magnitude of random variation in the particle speed.
|
static int |
SPHERE
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.SPHERE instead. |
static int |
SQUARE
Deprecated.
Use
SoParticleAnimation.EmitShapeTypes.SQUARE instead. |
SoSFEnum<SoParticleAnimation.TransparencyTypes> |
transparencyType
Deprecated.
Transparency type used for drawing particles.
|
SoSFTrigger |
trigger
Deprecated.
Has two meanings depending on the value of
particleLife :
particleLife = SoParticleAnimation.ONE_EMISSION : Starts a new emission. |
boundingBoxIgnoring, LINES, POINTS, POLYGONS, TEXT
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoParticleAnimation()
Deprecated.
Constructor.
|
getShapeType, isPrimitiveRestartAvailable, isPrimitiveRestartAvailable
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int POINT_SHAPE
SoParticleAnimation.ParticleShapes.POINT_SHAPE
instead.@Deprecated public static final int LINE_SHAPE
SoParticleAnimation.ParticleShapes.LINE_SHAPE
instead.@Deprecated public static final int BILLBOARD_SHAPE
SoParticleAnimation.ParticleShapes.BILLBOARD_SHAPE
instead.@Deprecated public static final int POINT
SoParticleAnimation.EmitShapeTypes.POINT
instead.@Deprecated public static final int CYLINDER
SoParticleAnimation.EmitShapeTypes.CYLINDER
instead.@Deprecated public static final int LINE
SoParticleAnimation.EmitShapeTypes.LINE
instead.@Deprecated public static final int SQUARE
SoParticleAnimation.EmitShapeTypes.SQUARE
instead.@Deprecated public static final int SPHERE
SoParticleAnimation.EmitShapeTypes.SPHERE
instead.@Deprecated public static final int CIRCLE
SoParticleAnimation.EmitShapeTypes.CIRCLE
instead.@Deprecated public static final int DISK
SoParticleAnimation.EmitShapeTypes.DISK
instead.@Deprecated public static final int GEOMETRY
SoParticleAnimation.EmitShapeTypes.GEOMETRY
instead.@Deprecated public static final int ONE_EMISSION
SoParticleAnimation.ParticleLifes.ONE_EMISSION
instead.@Deprecated public static final int CYCLIC_EMISSION
SoParticleAnimation.ParticleLifes.CYCLIC_EMISSION
instead.@Deprecated public static final int ADD
SoParticleAnimation.TransparencyTypes.ADD
instead.@Deprecated public static final int BLEND
SoParticleAnimation.TransparencyTypes.BLEND
instead.@Deprecated public static final int INHERITED
SoParticleAnimation.TransparencyTypes.INHERITED
instead.public final SoSFInt32 numParticles
public final SoSFFloat numParticlesVariation
numParticles
+ (numParticles
* numParticlesVariation
* RF) with -1 <= RF <= 1public final SoSFColor initialColor
public final SoSFVec3f initialColorVariation
initialColor
+ (initialColor
* initialColorVariation
* RF) with -1 <= RF <= 1.public final SoSFFloat initialOpacity
public final SoSFFloat initialOpacityVariation
initialOpacity
+ (initialOpacity
* initialOpacityVariation
* RF) with -1 <= RF <= 1.public final SoSFFloat initialSize
public final SoSFFloat initialSizeVariation
initialSize
+ (initialSize
* initialSizeVariation
* RF) with -1 <= RF <= 1.public final SoSFColor endColor
public final SoSFVec3f endColorVariation
endColor
+ (endColor
* endColorVariation
* RF) with -1 <= RF <= 1.public final SoSFFloat endOpacity
public final SoSFFloat endOpacityVariation
endOpacity
+ (endOpacity
* endOpacityVariation
* RF) with -1 <= RF <= 1.public final SoSFFloat endSize
public final SoSFFloat endSizeVariation
endSize
+ (endSize
* endSizeVariation
* RF) with -1 <= RF <= 1.public final SoSFInt32 lifeSpan
public final SoSFFloat lifeSpanVariation
lifeSpan
+ (lifeSpan
* lifeSpanVariation
* RF) with -1 <= RF <= 1.public final SoSFEnum<SoParticleAnimation.ParticleShapes> particleShape
SoParticleAnimation.BILLBOARD_SHAPE
shapes are textured.public final SoSFEnum<SoParticleAnimation.EmitShapeTypes> emitShapeType
SoParticleAnimation.POINT
): Centered at (0,0,0).
SoParticleAnimation.CYLINDER
): Centered at (0,0,0), Radius = 1, Height = 1, with the central axis parallel to the y-axis.
SoParticleAnimation.LINE
): From (-1,0,0) to (1,0,0).
SoParticleAnimation.SQUARE
): Centered at (0,0,0), Width = 2, Height = 2, aligned with the XY plane.
SoParticleAnimation.SPHERE
): Centered at (0,0,0) with Radius = 1.
SoParticleAnimation.CIRCLE
): Centered at (0,0,0), Radius = 1, and aligned with the XY plane.
SoParticleAnimation.DISK
): Centered at (0,0,0), Radius = 1, and aligned with the XY plane.
public final SoSFVec3f shapeScale
emitShapeType
== SoParticleAnimation.POINT
.public final SoSFVec2f dispersionAngles
dispersionAngles
[0] and pitch = dispersionAngles
[1]. yaw is an angle measured from y-axis and around the x-axis. pitch is an angle measured from the z-axis and around the y-axis. These two angles are ignored for all solid emitter shapes (SoParticleAnimation.SPHERE
, SoParticleAnimation.CYLINDER
).public final SoSFEnum<SoParticleAnimation.ParticleLifes> particleLife
SoParticleAnimation.ONE_EMISSION
) or cyclically (SoParticleAnimation.CYCLIC_EMISSION
).
If one-time emission is selected, particles are emitted when the field trigger
is set.public final SoSFFloat speed
public final SoSFFloat speedVariation
speed
+ (speed
* speedVariation
* RF) with -1 <= RF <= 1.public final SoSFFilePathString particleFilename
particleTexture
is updated. The standard image file formats are supported. See SoRasterImageRW
for the list. If the filename is not an absolute path name, the list of directories maintained by SoInput
is searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which the SoParticleAnimation
node was read.public final SoSFImage particleTexture
particleFilename
, an image read directly from an Open Inventor file, or an image defined programmatically using the methods provided by SoSFImage
. The default texture is a circular gradient, with gray in the middle and black on the edges. It contains no alpha values.public final SoSFFloat goalFramesPerSecond
public final SoSFTrigger trigger
particleLife
:
particleLife
= SoParticleAnimation.ONE_EMISSION
: Starts a new emission.
particleLife
= SoParticleAnimation.CYCLIC_EMISSION
: Initializes the cyclic emission.
public final SoSFEnum<SoParticleAnimation.TransparencyTypes> transparencyType
public final SoSFBool on
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com