Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

Introductory Example

Before we even start learning the language, here is an example of the CDL in action. The following describes a weighted block, able to fall freely once the simulation starts.

Camera(5,5,5);
LookAt(0,0,0);
Gravity(0,0,-10);
DefineSurface("default");

FreeBody, Block(1,1,1) : (mass=1.0, color="red");

The first four lines set the simulation up, defining the camera, gravity, and the default surface. The last line of the code is what sets the simulation in action. A single block, of size 1 meter on all sides, is suspended in the air and set free. The Block has a mass, and a color is set for its surface.

tutorial01.jpg

falling block, 0 sec

tutorial02.jpg

falling block, 2/3 sec

tutorial03.jpg

falling block, 4/3 sec


SimLib Reference Documentation