Synopsys

Based on the de facto standard Open Inventor, Coin3D is a set of libraries for creating 3D graphics applications. It is open source, multiplatform and backed up by the Oslo based Norwegian Company Systems in Motion (SIM).

 

by Devrim Erdem, July 2005

The scenegraph

I guess it was about 10 years ago, it was a beautiful May Saturday afternoon as I started turning the pages of OpenGL Performer's Programming Guide in front of a gorgeous SGI machine trying to swallow (for me) hard to understand concepts of the scenegraph library. With mixed feelings of respect, enlightenment and confusion, I was reading and finding out that (yet again) somebody has already implemented my ideas long time before I started programming.

As years passed by and OpenGL Performer started giving me headaches, I had enough arguments to convince myself to start writing my own scenegraph, so I did. It was a great experience and at the end (unsurprisingly) my own scenegraph didn't really bring any other cool features but it was shining on my resume.

In year 2005, I don't know of any graphics programmer who hasn't written his own scenegraph library. Now that I am driven by productivity rather than my challenge-chasing-engineer soul, I tend to pick a different weapon for each battle.

In this article, we will have a look at Coin3D, a perfect weapon (ehem scenegraph) for certain kind of 3d applications.

Coin3D

Coin3D In Action

If you are used to scenegraphs like OpenGL Performer and OSG, Coin3D looks a bit different at first sight. Fully compliant with Open Inventor, Coin3D is relatively high level and easier to get used to. Like Open Inventor, Coin3D is mosty used for general purpose scientific and engineering visualization.

Additionaly Coin3D has also found its place in the visual simulation applications as it can work with OpenFlight data. Another aspect of Coin3D for the visual simulation application developers is that we are nowadays not only expected to developed solid frame rate image generators but also interactive 3D desktop applications like instructor stations, situation awareness displays and DIS/HLA monitoring/visualization tools. This is where Coin3D can bring huge amounts of productivity due to its already existing windowing system and interactivity toolkits.

Source code availability and portability

The commercial company,SIM,behind Coin3D has released Coin3D as open source software long time ago. Today, SIM continues to actively develop and update Coin3D ( The Coin3D 2.4 has been updated already 4 times this year).

Unfortunately being open source doesn't automatically mean multi platform portability. SIM puts special effort to make sure that Coin3D stays multi platform as development goes on. Coin3D developer Lars J. Aas says “It's more or less like - if a platform has OpenGL support (and there are a lot of those), you can build Coin for it. People are using Coin on PocketPC devices out there, and it's not because we have provided it for them. We have basically just strived to write portable code and kept to C/C++ syntaxes that every obscure compiler in use out there can eat.

Extensibility

Coin3D comes with all the Open Inventor standard nodes and also includes 3D sound, 3D textures and parallel rendering on multiple processors.

However we all know, sooner or later we may need to or just because we prefer to do it right, we may wany to extend the scenegraph. At this point, the scenegraph shall rather be extensible by design to keep things simple and maintainable.

You can already guess the first method to extend Coin3D, it is to build custom nodes. The SoNode class is the base class for all nodes in Coin3D, so opening the source code for your favorite class node and learning from is rather easy.

The second concept is the so called "node kits". A node kit is built by combining existing building blocks into macros or patterns. You can think of node kits as a small scene graph tree. Coin3D has node kits for quickly adding cameras, lights and more.

Interacting with Your Scenegraph

SoPointLightManip

Even when developing an Image Generator for a flight simulator, I have found adding some interactivity to be helpful. Sooner or later I need to simply click a point and learn more about the node at that point like its full scenegraph path, the texture on it etc etc. Most scenegraph libraries consider interactivity as secondary task and avoid the overhead of implementing windowing system specific code. However IMHO a library shall take the ugly part of the work off my shoulders. Mostly scenegraph developers enjoy the nice OpenGL API as I need to find my way in the lovely Win32 or X11 APIs.

Open Inventor considers interactivity as core feature.

Unlike OpenGL, Coin3D doesn't hide under the argument "Graphics libraries don't deal with window handling".

SoHandleBoxManip

The Inventor has a well-defined concept for picking, selection, model rotation and more so Coin3D also implements those. That means adding a manipulator to pick, scale and move your models in the scene requires simply instantiating your preferred Coin3D classes (e.g. SoTrackballDragger, SoHandleBoxManip).

Coin Designer

Visualization is key to understanding. Especially if you are terribly (almost fataly) visualminded like I am. Not surprisingly the newly developed tool Coin Designer saved me a great deal of time when learning the basics of Coin3D nodes. After running Coin designer for the first time, I got a very good overview of nodes and the way Coin is working.

Coin Designer is a RAD (rapid application development) system and feels very much like Qt Designer. The leftmost pane includes all possible nodes and double clicking adds an instance of the node to the scene at the selected position in the scene tree. The right most pane lists the properties of the node and you can tweak them at runtime and they will be applied immediately.

To get a feeling of Coin Designer, you may want to have a look at these two tutorials :

About SIM and licensing

SIM has released Coin3D under a 3 different licenses. Coin Professional Edition, Coin Evaluation Edition and Coin Free Edition.

Basically, the Free Edition license allows you to download Coin3D and start working today. If you are releasing your software under GPL, Coin3D is completely free for you.

For those, who are lucky enough to find paying customers, Coin3D is licensed under a comfortable no royalties no runtime licenses style professional license. SIM provides email based support for their commercial customers. The professional license costs 1835 Euro ($2482) per developer seat for one year.

Quick Facts

The Open Inventor (.iv) file format has a binary counterpart, it is called "binary inventor file format".

Coin can parallellize multiple renderings of the same 3D model scene in separate rendering pipes, for instance for RAVEs and CAVEs with N pipes.

sim.no has created Profit, an open source library for reading OpenFlight files and Dime for reading DXF/DWG files. Both of which can be used with Coin3D.

Shader language support is already in CVS and it will be available in the next minor release.

Applications using Coin3D are listed here if you need to convince your boss.

Legal

OpenGL(r) is a registered trademark, OpenGL Performer and Open Inventor are trademarks of Silicon Graphics, Inc. All other product and trade marks contained herein are the trademarks of their respective owners. All the rest (c) 2005 by modsim.org.