I order to debug the osg program I am currently working on, I have written some functions to print the scene graph as text. For instance,

notify(NOTICE) << myNode;

will print the following to stdout:
--------------------------------------------
Camera:
    Group: Scene root
        Group: ../../models/polis-tri-v2.3ds
            Geode: Cube
                Geometry: : Vertices: 194
            Geode: Cylinder
                Geometry: : Vertices: 392
        Switch: Switch blobs on/off:  On: 0 1
PositionAttitudeTransform: : Pos: ( -3.21639, -1.86514, 0.587853 ), Scale: ( 1, 1, 1 )
                Geode:
                    ShapeDrawable:  -> Sphere: : Radius: 0.1
PositionAttitudeTransform: : Pos: ( 2.39094, -1.85198, -0.263018 ), Scale: ( 1.5, 1.5, 1.5 )
                Geode:
                    ShapeDrawable:  -> Sphere: : Radius: 0.1
PositionAttitudeTransform: : Pos: ( -0.351465, -1.85198, -0.231732 ), Scale: ( 1.9, 1.9, 1.9 )
        Geode:
            ShapeDrawable:  -> Sphere: : Radius: 0.1
PositionAttitudeTransform: : Pos: ( 2.39094, -1.85198, -0.263018 ), Scale: ( 1.9, 1.9, 1.9 )
        Geode:
            ShapeDrawable:  -> Sphere: : Radius: 0.1


--------------------------------------------

This is very useful for me, and would probably be useful for others as well. Should I add these functions to osg, and in that case, where and how?

begin:vcard
fn:Per Rosengren
n:Rosengren;Per
org:KTH;CVAP
adr:;;KTH;Stockholm;;SE-100 44;Sweden
email;internet:[EMAIL PROTECTED]
title:Ph.D. student
tel;work:+46 8 790 6203
tel;fax:+46 8 723 0302 
note:PGP keyID: 0xD40DD8E0
x-mozilla-html:FALSE
url:http://www.csc.kth.se/~perrose/
version:2.1
end:vcard

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to