20,741
edits
| Line 433: | Line 433: | ||
Now, let's consider another example - this time actually building a little scene graph hierarchy with multiple groups and nodes, using a for loop: | Now, let's consider another example - this time actually building a little scene graph hierarchy with multiple groups and nodes, using a for loop: | ||
[[File:Dumping-canvas-scenegraphs.png|thumb|right]] | |||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
var window = canvas.Window.new([320,160],"dialog"); | var window = canvas.Window.new([320,160],"dialog"); | ||
| Line 456: | Line 456: | ||
This will create a new group for each text node, added to its parent group. | This will create a new group for each text node, added to its parent group. | ||
[[File:Canvas-scenegraph-in-standalone-osgviewer.png|thumb|right]] | |||
<pre> | |||
osgviewer my-little-scenegraph.osg | |||
</pre> | |||
Once we inspect the scene graph, we'll see that it contains quite a bit of redundant state. | Once we inspect the scene graph, we'll see that it contains quite a bit of redundant state. | ||