In the example of the scene with the boat
and the lake, why does only the lake get coloured and not the
boat? It has to do with the order in which property nodes
take effect in an Open Inventor scene graph, a very important concept
to understand when using Open Inventor. Property nodes include both
geometric transformations (like RotationXYZ
), and nodes
that control the appearance of objects (like SoMaterial
).
There are a few simple rules about ordering to remember:
Separator
node.
That way the effect only lasts until you reach the bottom of the
enclosing Separator
.
RotationXYZ
nodes in your file positioned one
right after the other, both rotations take effect. The first rotation
in the file takes first, the second rotation takes effect after the
first one.
Material
nodes in your file positioned one right after the other, any colour
specified in the second node would override the colour specified
in the first node.
Why does this issue of order of effect come up? It is an artifact of the process by which Open Inventor uses the scene graph to construct the image you see in a viewer. Open Inventor traverses the scene graph, which means that it starts at the root node and follows the links to the various child nodes. As it visits each node, it gets more information about what the scene should look like. Open Inventor doesn't have to finish traversing the entire scene graph in order to begin displaying the picture. The action of visiting each node is used to render more and more of the image.
Scene graph traversals happen whenever something changes in the scene. The things that initiate or modify traversal are:
Blinker
engines.
Understanding the traversal process provides you with a key to creating animations in Open Inventor. The way animation works is by causing a traversal. The person viewing the animation will perceive change or motion when the rendered image after the traversal looks different from the rendered image before the traversal.
More information about scene graph traversal in Open Inventor is available in chapter 3 of Inventor Mentor.