Scene language
Updated on October 22, 2026
SimuLab scenes aren't drawn with a graphic editor: they're described in writing, with a simple language built for science exercises called SimulScript. That way you define exactly which shapes appear, how they move and from which viewpoint.
Where to edit the scene
In the exercise editor, go to the Advanced section and open Advanced options. There you'll find the Simulation code field. Click Preview to see the scene before saving. If part of it can't be drawn, you'll see a warning.
When the AI generates an exercise with an animation, it writes this same code, so you can open it and tweak it.
General structure
A scene has two parts:
- The
sceneblock, which sets the type (2dor3d), the visible area withspaceand all the shapes. - One or more
anim start..endblocks, which describe how the shapes move or change over time.
Inside an anim block, each line can start with @start..end to set the time interval for that particular animation. With var you can declare values you reuse in the scene.
Available shapes
2D scenes
| Element | What it's for |
|---|---|
point |
Marks a position, with an optional label |
vector |
Arrow with direction and magnitude |
segment |
Segment between two points |
line |
Line through two points |
circle |
Circle, filled or outlined |
rect |
Rectangle |
polygon |
Polygon with as many vertices as you need |
curve |
Curve defined by a function |
label |
Text placed in the scene |
emitter |
Particle emitter (fluids, fields) |
axis |
Labeled Cartesian axes |
3D scenes
| Element | What it's for |
|---|---|
sphere |
Sphere |
box |
Rectangular box |
cylinder |
Cylinder |
plane |
Plane |
arrow3 |
3D arrow |
molecule |
Molecule from its SMILES formula |
camera |
Initial camera view |
Available animations
| Animation | What it does |
|---|---|
move |
Moves the shape to another position |
rotate |
Rotates it |
scale |
Changes its size |
fade |
Changes its opacity |
oscillate |
Makes it oscillate in a direction |
orbit |
Makes it orbit another shape |
follow |
Moves it along a curve |
trace |
Draws the path it travels |
spin |
Spins it continuously on an axis |
pulse |
Makes its size pulse |
flow |
Makes particles flow along the shape |
show / hide |
Shows or hides the shape |
set |
Changes a property at a given moment |
Minimal example
This code defines a 2D scene with a point moving to the right:
scene 2d
space x=-5..5 y=-5..5
point A at (0, 0) color=blue label="A"
anim 0..3
move A to (4, 0)
It creates a two-dimensional scene, sets the visible area between −5 and 5 on both axes, places a blue point A at the origin and moves it to (4, 0) between second 0 and second 3.
The scene is optional. If you don't write any code, the exercise works the same, without an animation.
FAQ
Do I need to know how to code? No. Each line describes a shape or a motion with words that look like what they do. A few minutes of practice and the examples are enough.
Which colors can I use?
red, blue, green, yellow, orange, purple, cyan, magenta, white, black and gray.
Can I use formulas in values?
Yes. Expressions accept sin, cos, tan, sqrt, exp, ln, log, abs, pow, min, max, floor, ceil, sign and atan2, and the constants pi, e and t (the animation time).
Next steps
- Interactive scenes — what the student sees when an exercise has a scene.
- The exercise editor — where the scene is written and previewed.
- Solve an exercise — how the solve screen works.