drupal_add_library('system', 'drupal.collapse');


In order to get started with your projects, it's essential to understand a few of the key concepts of the language. The following is a brief outline of the different entities used when rendering a model:

  • rules — 3D shapes are generated by traversing rules, which define a simple recursive structure;
  • shape adjustments — adjustment operators will perform translations, rotations and scaling in 3D-space as well as adjust colors and weight values;
  • isosurfaces — isosurfaces are defined by evaluating a function in each coordinate of a voxel grid (the result is a mesh which can be appended within any rule);
  • transforms — rules can be animated by other rules, which are denoted as 'transforms'; the effect of the transform rule is reflected as a transformation from within the reference space of the parent rule;
  • camera rule — a camera rule works similarly to a transform, but is used to adjust the position and direction of the camera;
  • frames — any transform or camera rule, need to invoke the FRAME operator to emit a frame; each frame will be associated with a specific timemark, which depends on the fps of the rule;
  • shaders  — an project may use customized vertex and fragment shaders in order to render the scenes in different ways;
  • program  — a program defines a sequence of rendering steps, where each rendering step can have its own shader programs.

Typically it's a good idea to reuse existing implementations of shaders or programs instead of reinventing the wheel. This is done by using the @import preprocessor directive, which allows you to import code from any other project. This also permits you to reuse the rules defined in other projects, which is a good idea if you don't want to implement all the basic rules for each new project.

Sample Project


Language Reference