Source code for all the examples presented in these tutorials is included in the SDK.
(Note: the actual C++ code of the examples in the SDK might be slightly different because we constantly update them.)
Demos with Irrlicht 3D interface
These examples are the most descriptive and amusing, since they show
Chrono::Engine features within a graphical user interface, using a
realtime 3D visualization engine called Irrlicht. (To compile these examples you must install also the Irrlicht API on your computer). These demos are also available as precompiled binaries in the Chrono::Engine directory bin/Win32_VisualStudio/. To play the precompiled binaries you don't need Irrlicht installed on your computer.
We used Irrlicht, but of course you can use alternative libraries, such as GLUT, OpenGL, Ogre, etc. Consider these tutorial as suggestions.
The visualization runs in real-time for most systems with a decent graphic adaptor and a recent processor.
| Name | Description | Level | Picture |
| demo_crank | The simpliest way to integrate
Chrono::Engine in the Irrlicht 3D visualization library: in fact the
coordinates of the joints are simply used as end-points of simple
polygonal lines which are drawn in the 3D space for each frame redraw,
to show a very simplified 'skeleton' of a slider-crank mechanism. The demo also teaches how to: - create constraints and 'engine' objects - make a real-time application, where Chrono::Engine adapts the integration step to the speed of the CPU. |
Basic | ![]() |
| demo_fourbar | This tutorial is similar to
the demo_crank example, but here a small user-interface is created, so
that the user can play with a slider to modify the speed of the motor.
The user interface is created with simple GUI features of Irrlicht, but
other kind of interfaces/visualization systems could be used. Here you can also learn - how to make a four-bar linkage - an example of how to plot/fetch data during the simulation. - use a direct solver instead of iterative solver, for highest precision. |
Intermediate | ![]() |
| demo_collision | A bunch of random shapes will fall into a box, stacking in random order. Differently from the two examples above, here a special object is used to encapsulate Chrono::Engine rigid bodies, and some 'shortcuts' are used to manage them in Irrlicht. Learn about: - collisions, contacts and friction - use the easy ChBodySceneNode class for managing Irrlicht objects which encapsulates ChBody items. - describe compound shapes |
Intermediate | ![]() |
| demo_bricks | Another tutorial about collisions. Create a stack of geometric primitives. Learn about: - how to change the settings of the stepper in sake of higher precision or higher computing speed. - create a motor between two parts. - turn on the information panel by pressing the 'i' key on the keyboard. |
Intermediate | ![]() |
| demo pendulum | Create some swinging pendulums, anchored to sliding joints. They move when the fan pushes some air toward them. This tutorial shows how to: - create a pendulum - apply custom forces using 'force accumulators' (the simplified aereodinamic drag, in this case) - create constraints with upper-lower limits (the horizontal sliding joints between pendula and truss) |
Intermediate | ![]() |
| demo_gears | Create a transmission made of pulleys, spur gears, bevel gears. Custom simplified constraints are
available, to avoid the simulation of contacts between gear teeth. This tutorial shows how to: - use ChLinkGear constraints to represent simplified gear interaction in 3D space - the ChLinkPulley constraint is used to model simplified pulleys in 3D space. - manage rotations of references using ChCoordsys and ChFrame classes. - create a motor between two parts. |
Intermediate | ![]() |
| demo_mecanum | Simulate a small mobile robot with omnidirectional 'mecanum' wheels. Use keyboard to perform basic motion. This tutorial shows how to: - make complex models, with 'barrel' collision shapes. - add motors between parts. - use the keyboard in Irrlicht 3D view, to interact with the system in realtime. - manage rotations of references using ChCoordsys and ChFrame classes. |
Advanced | ![]() |
| demo_friction | A benchmark that show the feature of spinning friction (aka 'drilling' friction) and rolling
friction. These types of frictions are useful for rolling objects like wheels, spheres etc. and can
be optionally turned on. This tutorial shows how to: - enable rolling and spinning friction. - impose initial velocity and angular velocity to objects. |
Intermediate | ![]() |
| demo_suspension | Simulate a simplified vehicle with double-wishbone suspensions (like racing cars) and drive it using
the mouse over some sliders in the interface. This tutorial shows how to: - use the ChLinkDistance to represent massless rods, saving computational efforts. - change the friction coefficient depending on the contact zone (here, half of the ground plane has lower friction). - use the Irrlicht interface system to interact with a model. - use ChLinkSpring to make spring-dampers |
Advanced | ![]() |
| demo_tracks | Simulate a simplified vehicle with tracks, that interact with obstacles, and that can be driven by the user. This tutorial shows how to: - create different 'families' of collision objects (ex. to avoid that unnecessry contacts are created between adjacent track shoes). - make custom compound collision shapes. - load a non-concave collision mesh that is decomposed in convex parts |
Advanced | ![]() |
Core features
These examples are about the basic features of the
Chrono::Engine programming
system, which can be used also for non-physics stuff. Some of these
tutorials can be skipped (they deal with 'low level' stuff..).
| Name | Description | Level | Picture |
| demo_math | Demo on
how to use Chrono mathematical objects and functions (vector math,
matrices, linear algebra, etc.). No GUI: only text output. |
Basic | ![]() |
| demo_coords | Tutorial
on how to perform 3D coordinate manipulation (rotation and translations
of points, frames, etc.) thank to C++ objects and custom operators
introduced in Chrono::Engine. No GUI: only text output. |
Basic | ![]() |
| demo_stream | Tutorial
on files, streams, serialization. Learn: - streams and files - serialization, with versioning and dynamic creation (class factory) - class runtime type identification. No GUI: only text output. |
Intermediate | ![]() |
| demo_sharedptr | Tutorial
on how Chrono::Engine core functionality can handle smart pointers and
shared objects. These smart pointers can be useful also in projects non
related to physics simulation too. No GUI: only text output. |
Advanced | ![]() |
Basics
These tutorials teach how to setup physical systems
in Chrono::Engine.
Here we do not use any graphical user interface: see the 'Irrlicht'
tutorials
for demos with a 3D graphical output.
| Name | Description | Level | Picture |
| demo_buildsystem | Tutorial
which teaches the basic approach to build and simulate mechanical
systems. No 3D user interface is used here, so you compile this example even if you do not
have Irrlicht 3D visualization library installed. Learn how: - create a physical system (a slider-crank) - add/remove rigid bodies - create mechanical joints between bodies - perform a simulation No GUI: only text output. |
Basic | ![]() |
MS VisualStudio C++ IDE
Compile an develop Chrono::Engine applictions without using the makefile system. These examples
are contained in the demo/msvc/ directory. Read the README.TXT for informations about how to configure your
Microsoft VisualStudio IDE.
| Name | Description | Level | Picture |
| demo_oscillator | Develop a C++/CLI .NET application that uses Chrono::Engine and embeds a small Irrlicht view.
Of course you are not forced to embed the Irrlicht 3D viewing system in the GUI of your .NET projects,
but this is a general example - if you prefer, you can use directly OpenGL or DirectX or other methods. This tutorial shows how to: - use Chrono::Engine in .NET, using C++/CLI. - use an Irrlicht 3D view in a .NET user interface. - configure the Micosoft VisualStudio IDE to compile Chrono applications without using 'makefiles'. - simulate a simple 1-DOF oscillator. |
Intermediate | ![]() |
| Visual C++ wizard | This is not a ready-to-use example, but it is a tutorial on how to use the ChronoEngineWizard
in your Microsoft Visual C++ Express IDE to set up quickly a new project. This tutorial shows how to: - use Visual C++ IDE to create a new project using the custom ChronoEngineWizard - quickly integrate Chrono::Engine in your C++ projects - create a spring-damper system between two bodies - easy display of springs in Irrlicht view |
Basic | ![]() |
Matlab
If you own a copy of the Matlab(TM) software, you can interact with it from Chrono::Engine,
in order to plot data, make complex computations, perform co-simulations, etc.
LCP solver
These tutorials teach how to use the
HyperOCTANT solver. The HyperOCTANT
technology is a custom component of Chrono::Engine, and it is a
collection
of methods for solving the large LCP (Linear Complementarity Problems)
which
typically arise in multibody simulations.
| Name | Description | Level | Picture |
| demo_lcp_solver | Tutorial teaching how to use the LCP solver, which is based on collections of 'variables' and 'constraint' objects as interfaces to the method. Two kinds of solvers are compared: and iterative fixed-point method and a direct (simplex) method. No GUI: only text output. | Advanced | ![]() |













