3.6. Traversing VRML graph

Traversing VRML graph means visiting all active VRML graph nodes in a depth-first search order. By active nodes we mean that only the visible (or affecting the visible) parts of the graph are browsed — for example, only one child of a Switch and LOD nodes is visited.

You can traverse nodes using Traverse or TraverseFromDefaultState methods. For each visited node, a callback function will be called.

The most important feature of traversing is that whole VRML state that we talked about in Section 1.5, “VRML 1.0 state” is collected along the way. For each visited node traverse callback gets all the information about accumulated transformation, active light nodes and (meaningful only for VRML 1.0 nodes) currently bound property nodes (material, texture etc.).