Traversing the scene graph

A typical traversal consists of the following steps:

  1. First, start at an arbitrary node (for example, the root node).
  2. Move down (or sometimes up) the scene graph recursively to the child nodes, until a leaf node is reached, or a node with no children is reached.
  3. Backtrack to the most recent node that doesn't finish exploring, and repeat the above steps. This can be called a depth-first search of a scene graph.

Different updating and rendering operations will be applied to all scene nodes during traversals, which makes traversing a key feature of scene graphs. There are several types of traversals, with different purposes:

  1. An event traversal firstly processes mouse and keyboard inputs, and other user events, while traversing ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.