Particles
16 nodes
On this page 16
Add Particle Burst
FunctionThe scene with a burst: particles thrown from a ball all at once at a moment, in every direction, glowing or solid. Debris from an impact, a firework's shell.
AddParticleBurst -> Particle Scene Description
scene: Particle Scene Description
name: Text
position: Vector3d
radius: Number
count: Integer
speed: Number
time: Number
lifetime: Number
glowing: TruthParticleSceneDescription AddParticleBurst(
ParticleSceneDescription scene,
string name,
Vector3d position,
double radius = 0.1,
int count = 20000,
double speed = 6,
double time = 0,
double lifetime = 3,
bool glowing = true)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| name | Text | — | The emitter's name. |
| position | Vector3d | — | The ball's centre (m). |
| radius | Number | 0.1 | Its radius (m). |
| count | Integer | 20000 | How many particles. |
| speed | Number | 6 | How fast they are thrown (m/s). |
| time | Number | 0 | When (s). |
| lifetime | Number | 3 | How long they last (s). |
| glowing | Truth | True | Glowing sparks; off, solid grey debris. |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Add Particle Emitter
FunctionThe scene with a ball that gives off particles of one's own making: solid specks lit by the sun, or glowing ones when Glow is above 0.
AddParticleEmitter -> Particle Scene Description
scene: Particle Scene Description
name: Text
position: Vector3d
radius: Number
rate: Number
velocity: Vector3d
spread: Number
lifetime: Number
size: Number
colour: Color
glow: NumberParticleSceneDescription AddParticleEmitter(
ParticleSceneDescription scene,
string name,
Vector3d position,
double radius,
double rate,
Vector3d velocity,
double spread,
double lifetime,
double size,
ColorElement colour,
double glow = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| name | Text | — | The emitter's name. |
| position | Vector3d | — | Its centre (m). |
| radius | Number | — | Its radius (m). |
| rate | Number | — | Particles born per second. |
| velocity | Vector3d | — | The velocity they are born with (m/s). |
| spread | Number | — | The speed of the random part of that velocity (m/s). |
| lifetime | Number | — | How long a particle lives (s). |
| size | Number | — | A particle's radius (m). |
| colour | Color | — | A particle's colour. |
| glow | Number | 0 | How brightly it glows; 0 is a solid speck. |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Add Particle Obstacle Box
FunctionThe scene with a solid box that particles bounce off.
AddParticleObstacleBox -> Particle Scene Description
scene: Particle Scene Description
name: Text
position: Vector3d
size: Vector3dParticleSceneDescription AddParticleObstacleBox(
ParticleSceneDescription scene,
string name,
Vector3d position,
Vector3d size)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| name | Text | — | The solid's name. |
| position | Vector3d | — | Its centre (m). |
| size | Vector3d | — | Its size (m) along X, Y and Z. |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Add Particle Obstacle Sphere
FunctionThe scene with a solid ball that particles bounce off.
AddParticleObstacleSphere -> Particle Scene Description
scene: Particle Scene Description
name: Text
position: Vector3d
radius: NumberParticleSceneDescription AddParticleObstacleSphere(
ParticleSceneDescription scene,
string name,
Vector3d position,
double radius)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| name | Text | — | The solid's name. |
| position | Vector3d | — | Its centre (m). |
| radius | Number | — | Its radius (m). |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Add Snowfall
FunctionThe scene with snow falling from a slab of air: white flakes that drift with the wind and the turbulence and settle. Snow wants an air that carries it: New Particles with Drag about 6, Turbulence about 0.7 and Bounce 0.
AddSnowfall -> Particle Scene Description
scene: Particle Scene Description
name: Text
position: Vector3d
size: Vector3d
rate: Number
lifetime: NumberParticleSceneDescription AddSnowfall(
ParticleSceneDescription scene,
string name,
Vector3d position,
Vector3d size,
double rate = 8000,
double lifetime = 9)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| name | Text | — | The emitter's name. |
| position | Vector3d | — | The middle of the slab the flakes are born in (m). |
| size | Vector3d | — | The slab's size (m) along X, Y and Z. |
| rate | Number | 8000 | Flakes per second. |
| lifetime | Number | 9 | How long a flake lasts (s): long enough to reach the ground and lie there a while. |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Add Spark Fountain
FunctionThe scene with a fountain of sparks: glowing streaks thrown from a point, yellow turning red as they cool, which fall and bounce.
AddSparkFountain -> Particle Scene Description
scene: Particle Scene Description
name: Text
position: Vector3d
direction: Vector3d
rate: Number
spread: Number
lifetime: NumberParticleSceneDescription AddSparkFountain(
ParticleSceneDescription scene,
string name,
Vector3d position,
Vector3d direction,
double rate = 30000,
double spread = 1.1,
double lifetime = 2.6)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| name | Text | — | The emitter's name. |
| position | Vector3d | — | Where the sparks come from (m). |
| direction | Vector3d | — | The velocity they are thrown with (m/s): (0, 0, 6) is straight up, to about two metres. |
| rate | Number | 30000 | Sparks per second. |
| spread | Number | 1.1 | The speed of the random part of their velocity (m/s): what opens the jet into a fountain. |
| lifetime | Number | 2.6 | How long a spark glows (s). |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Export Particle Flipbook
FunctionRuns the scene and writes a flipbook of its particles as a PNG with transparency, with its layout beside it as a text file. Returns the PNG's path.
ExportParticleFlipbook -> Text
scene: Particle Scene Description
path: Text
duration: Number
eye: Vector3d
target: Vector3d
columns: Integer
rows: Integer
frameSize: Integer
fieldOfView: Number
showGlow: Truthstring ExportParticleFlipbook(
ParticleSceneDescription scene,
string path,
double duration,
Vector3d eye,
Vector3d target,
int columns = 8,
int rows = 8,
int frameSize = 256,
double fieldOfView = 40,
bool showGlow = true)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| path | Text | — | The PNG to write; its folder is created if missing. |
| duration | Number | — | How long to run (s). |
| eye | Vector3d | — | Where the camera stands (m). |
| target | Vector3d | — | What it looks at (m). |
| columns | Integer | 8 | Frames in a row. |
| rows | Integer | 8 | Rows of frames. |
| frameSize | Integer | 256 | A frame's width and height in pixels. |
| fieldOfView | Number | 40 | The camera's vertical field of view in degrees. |
| showGlow | Truth | True | Give glowing particles an alpha as bright as they are; off, they are colour without alpha, for a game that adds the sheet. The text file says which. |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
New Particles
FunctionEmpty air for particles to fly in, over a ground at height 0.
NewParticles -> Particle Scene Description
gravity: Number
wind: Vector3d
drag: Number
turbulence: Number
bounce: Number
ground: Truth
dusk: TruthParticleSceneDescription NewParticles(
double gravity = 9.81,
Vector3d wind,
double drag = 0.5,
double turbulence = 0,
double bounce = 0.4,
bool ground = true,
bool dusk = false)Parameters
| name | type | default | description |
|---|---|---|---|
| gravity | Number | 9.81 | Gravity (m/s²), pointing down along -Z. |
| wind | Vector3d | — | The wind (m/s). |
| drag | Number | 0.5 | How fast a particle takes the air's velocity (per second): 0 flies free of the air, 0.5 is a spark, 6 drifts like snow. |
| turbulence | Number | 0 | The speed of the air's own swirls (m/s); 0 is still air. |
| bounce | Number | 0.4 | The share of its speed a particle keeps when it bounces: 0 lands and stays. |
| ground | Truth | True | Whether there is a ground at height 0 to land on. |
| dusk | Truth | False | Take pictures under a dark sky, against which glowing particles show. |
Returns
| result | Particle Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Count
FunctionHow many particles are alive in a recorded frame.
ParticleCount -> Integer
result: Particle Result
frame: Integerint ParticleCount(ParticleResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Particle Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Flipbook
FunctionRuns the scene and takes frames of the particles by themselves, evenly over the run, into one picture with transparency: a flipbook, the sprite sheet a game plays sparks back from. Frames run from the left, rows from the top. A solid particle is opaque. A glowing one adds light and hides nothing, so exactly it is colour with no alpha at all, and a sheet of sparks so made shows as nothing wherever pictures are blended by their alpha: Show Glow gives the light an alpha as bright as it is.
ParticleFlipbook -> Pixel Image
scene: Particle Scene Description
duration: Number
eye: Vector3d
target: Vector3d
columns: Integer
rows: Integer
frameSize: Integer
fieldOfView: Number
showGlow: TruthPixelImage ParticleFlipbook(
ParticleSceneDescription scene,
double duration,
Vector3d eye,
Vector3d target,
int columns = 4,
int rows = 4,
int frameSize = 128,
double fieldOfView = 40,
bool showGlow = true)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| duration | Number | — | How long to run (s). |
| eye | Vector3d | — | Where the camera stands (m). |
| target | Vector3d | — | What it looks at (m). |
| columns | Integer | 4 | Frames in a row. |
| rows | Integer | 4 | Rows of frames. |
| frameSize | Integer | 128 | A frame's width and height in pixels. |
| fieldOfView | Number | 40 | The camera's vertical field of view in degrees. |
| showGlow | Truth | True | Give glowing particles an alpha as bright as they are, so that they show in a viewer and in tools that blend by alpha. Off, they are colour without alpha: exact, for a game that adds the sheet to its picture. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Frame Count
FunctionHow many frames a run recorded.
ParticleFrameCount(result: Particle Result) -> Integer
int ParticleFrameCount(ParticleResult result)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Particle Result | — |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Frame Time
FunctionThe simulated time of a recorded frame (s).
ParticleFrameTime -> Number
result: Particle Result
frame: Integerdouble ParticleFrameTime(ParticleResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Particle Result | — | |
| frame | Integer | — |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Picture
FunctionRuns the scene for a time and takes a picture of it: the ground, the solids and the particles.
ParticlePicture -> Pixel Image
scene: Particle Scene Description
time: Number
eye: Vector3d
target: Vector3d
width: Integer
height: Integer
fieldOfView: NumberPixelImage ParticlePicture(
ParticleSceneDescription scene,
double time,
Vector3d eye,
Vector3d target,
int width = 640,
int height = 480,
double fieldOfView = 40)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| time | Number | — | How long to run before the picture (s). |
| eye | Vector3d | — | Where the camera stands (m). |
| target | Vector3d | — | What it looks at (m). |
| width | Integer | 640 | The picture's width in pixels. |
| height | Integer | 480 | The picture's height in pixels. |
| fieldOfView | Number | 40 | The camera's vertical field of view in degrees. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Points
FunctionWhere the particles of a recorded frame are (m): a point per live particle, which the 3D view draws.
ParticlePoints -> Vector3d Array
result: Particle Result
frame: IntegerVector3d[] ParticlePoints(ParticleResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Particle Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
Returns
| result | Vector3d Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Particle Velocities
FunctionHow the particles of a recorded frame move (m/s): a velocity per live particle, in the order of Particle Points.
ParticleVelocities -> Vector3d Array
result: Particle Result
frame: IntegerVector3d[] ParticleVelocities(ParticleResult result, int frame)
Parameters
| name | type | default | description |
|---|---|---|---|
| result | Particle Result | — | The run. |
| frame | Integer | — | The recorded frame, from 0. |
Returns
| result | Vector3d Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation
Simulate Particles
FunctionRuns the scene for a time and records its particles at every frame, for the point nodes to read. A frame of a hundred thousand particles is 2.4 MB, so record few frames of a busy scene (Keep Every).
SimulateParticles -> Particle Result
scene: Particle Scene Description
duration: Number
framesPerSecond: Number
keepEvery: IntegerParticleResult SimulateParticles(
ParticleSceneDescription scene,
double duration = 2,
double framesPerSecond = 30,
int keepEvery = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Particle Scene Description | — | The scene. |
| duration | Number | 2 | How long to run (s). |
| framesPerSecond | Number | 30 | Frames per second of simulated time. |
| keepEvery | Integer | 1 | Record every frame (1), every second one (2) and so on; the last frame is always recorded. |
Returns
| result | Particle Result |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Particles
- Package
- Physics Simulation