Voxeltoy language documentation

Introduction

Voxeltoy language is a compact way to describe a series of rendering operations that generates a 3d model made of voxels. It is inspired by the similar language for 2d image context free.

Some introduction to the language concepts can be found on my blog.

This document is a work in progress. Please contact me if you need clarifications.

Primitive shapes

cube
A 1x1x1 cube, a.k.a voxel.
sphere
A unit shere
cylinder
A unit cylinder along the z direction.

Adjustments

Geometry

x x [y:0] [z:0]
Translation along X, Y and Z. Since y and z are defaulted to 0, using a single argument make a translation along X only.
y y [z:0]
Translation along Y and Z.
z z
Translation along Z.
s x [y:1] [z:1]
Scale along Z, Y and Z.
sx x
Scale along X.
sy y
Scale along Y.
sz z
Scale along Z.
rx a
Rotation along X axis.
ry a
Rotation along Y axis.
rz a
Rotation along Z axis.

Color

light v [target:1]
Adjust the light value toward the target.
sat v [target:1]
Adjust saturation value toward the target.
hue v [target:0]
With a single argument, add the value to the current hue (ranging from 0 to 360). With two argument, adjust the hue toward the target.

Other

antialiased v
Set whether to render anti-aliased voxels. This basically allow voxel to have visibility values ranging from 0 to 1 (instead of only be 0 or 1). The smooth renderer can then use this information to compute the voxel normal. The value should be 1 or 0.
paint
Set paint mode. In paint mode we only change the color of currently visible voxels.
seed v
Fix the random number generator seed. Useful to force the rendering to be always the same.
life n
Automatically stop the branch after n operations.
wait n
Block the execution for a n rendering ticks.