20,741
edits
m (→Dumping Canvas scene graphs to disk: adding patches from topic branch) |
m (→Dumping Canvas scene graphs to disk: need to come up with a geshi scheme for osg scene graphs ??) |
||
Line 357: | Line 357: | ||
This is what a simple Canvas sub-scenegraph may look like: | |||
<syntaxhighlight lang="text">MatrixTransform { | |||
nodeMask 0xffffffff | |||
cullingActive TRUE | |||
StateSet { | |||
rendering_hint DEFAULT_BIN | |||
renderBinMode OVERRIDE | |||
binNumber 0 | |||
binName PreOrderBin | |||
} | |||
referenceFrame RELATIVE | |||
Matrix { | |||
1 0 0 0 | |||
0 1 0 0 | |||
0 0 1 0 | |||
0 0 0 1 | |||
} | |||
num_children 1 | |||
Geode { | |||
nodeMask 0xffffffff | |||
cullingActive TRUE | |||
num_drawables 1 | |||
osgText::Text { | |||
UniqueID Text_0 | |||
StateSet { | |||
UniqueID StateSet_1 | |||
rendering_hint TRANSPARENT_BIN | |||
renderBinMode USE | |||
binNumber 10 | |||
binName DepthSortedBin | |||
} | |||
supportsDisplayList FALSE | |||
useDisplayList FALSE | |||
useVertexBufferObjects FALSE | |||
color 1 0 0 1 | |||
font /home/hooray/sources/fgroot/Fonts/LiberationFonts/LiberationSans-Bold.ttf | |||
fontResolution 32 32 | |||
characterSize 15 1 | |||
characterSizeMode OBJECT_COORDS | |||
alignment LEFT_CENTER | |||
rotation 1 0 0 6.12303e-17 | |||
layout LEFT_TO_RIGHT | |||
position 0 0 0 | |||
drawMode 1 | |||
BoundingBoxMargin 0 | |||
BoundingBoxColor 0.94902 0.945098 0.941176 1 | |||
text "Some text" | |||
backdropType NONE | |||
backdropHorizontalOffset 0.07 | |||
backdropVerticalOffset 0.07 | |||
backdropColor 0 0 0 1 | |||
backdropImplementation NO_DEPTH_BUFFER | |||
colorGradientMode SOLID | |||
colorGradientTopLeft 1 0 0 1 | |||
colorGradientBottomLeft 0 1 0 1 | |||
colorGradientBottomRight 0 0 1 1 | |||
colorGradientTopRight 1 1 1 1 | |||
} | |||
} | |||
} | |||
</syntaxhighlight> | |||
To dump the scene graph of the whole Canvas, just invoke the <code>dumpSceneGraph()</code> method on the top-level root node like this: | |||
<syntaxhighlight lang="nasal"> | |||
root.dumpSceneGraph('my-canvas-scenegraph.osg'); | |||
</syntaxhighlight> | |||
=== Tracking update frequency per Canvas/Element === | === Tracking update frequency per Canvas/Element === |