Hi try lesson18 from, the tutorial examples form Leandro Motta Baros. The whole tutorial series is on the site on the Tutorials section. http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/LMBs_OSG_Examples.zip In short he uses the TriangleFunctor class to let osg give you the triangles it produces when it is actually rendering.
Dimi ----- Original Message ---- From: Markus Husseini <[email protected]> To: [email protected] Sent: Mon, December 21, 2009 5:10:00 PM Subject: [osg-users] Get Vertexdata from osg File Hi, i need some help to solve a problem. I tried to get the Vertexdata from my geometry. The geometry is loaded by an osg file. here the file: [code] MatrixTransform { DataVariance DYNAMIC name "Scene Root" nodeMask 0xff cullingActive TRUE StateSet { UniqueID StateSet_0 DataVariance DYNAMIC rendering_hint DEFAULT_BIN renderBinMode INHERIT GL_LIGHTING ON } referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 } num_children 1 MatrixTransform { DataVariance DYNAMIC name "Box01" nodeMask 0xff cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 } num_children 1 Geode { UniqueID Geode_1 DataVariance DYNAMIC name "Box01-GEODE" nodeMask 0xff cullingActive TRUE num_drawables 1 Geometry { DataVariance DYNAMIC useDisplayList TRUE useVertexBufferObjects FALSE PrimitiveSets 1 { DrawArrays TRIANGLES 0 36 } VertexArray Vec3Array 36 { -0.5 -0.5 0 0.5 -0.5 0 -0.5 0.5 0 0.5 0.5 0 -0.5 -0.5 1 0.5 -0.5 1 -0.5 0.5 1 0.5 0.5 1 0.5 0.5 0 -0.5 -0.5 0 0.5 0.5 1 -0.5 -0.5 1 -0.5 -0.5 0 0.5 -0.5 0 0.5 -0.5 1 0.5 -0.5 1 -0.5 -0.5 1 -0.5 -0.5 0 0.5 -0.5 0 0.5 0.5 0 0.5 0.5 1 0.5 0.5 1 0.5 -0.5 1 0.5 -0.5 0 0.5 0.5 0 -0.5 0.5 0 -0.5 0.5 1 -0.5 0.5 1 0.5 0.5 1 0.5 0.5 0 -0.5 0.5 0 -0.5 -0.5 0 -0.5 -0.5 1 -0.5 -0.5 1 -0.5 0.5 1 -0.5 0.5 0 } VertexIndices UniqueID UShortArray_2 UShortArray 36 { 0 2 3 8 1 9 4 5 7 10 6 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 } NormalBinding PER_VERTEX NormalArray Vec3Array 36 { 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 } NormalIndices Use UShortArray_2 ColorBinding OVERALL ColorArray Vec4Array 1 { 0.101961 0.694118 0.101961 1 } } } } } [/code] I had use following code example: [url]http://www.openscenegraph.org/projects/osg/wiki/Support/ProgrammingGuide/AnalysingAScenegraph[/url] My results in the console are : vertex 0 is index 0 at 1.55309e-030,3.97231e-034,0 vertex 1 is index 1 at 0,-1,0 vertex 2 is index 2 at 0,-1,0 vertex 3 is index 3 at 0,-1,0 vertex 4 is index 4 at 0,-1,0 vertex 5 is index 5 at 0,1,0 vertex 6 is index 6 at 0,1,0 vertex 7 is index 7 at 0,1,0 vertex 8 is index 8 at 0,1,0 vertex 9 is index 9 at 0,-1,0 vertex 10 is index 10 at 0,-1,0 vertex 11 is index 11 at 0,1,0 vertex 12 is index 12 at 0,1,0 vertex 13 is index 13 at -1,0,0 vertex 14 is index 14 at -1,0,0 vertex 15 is index 15 at -1,0,0 vertex 16 is index 16 at -1,0,0 vertex 17 is index 17 at -1,0,0 vertex 18 is index 18 at -1,0,1 vertex 19 is index 19 at 0,0,1 vertex 20 is index 20 at 0,0,1 vertex 21 is index 21 at 0,0,1 vertex 22 is index 22 at 0,0,1 vertex 23 is index 23 at 0,0,1 vertex 24 is index 24 at 0,0,0 vertex 25 is index 25 at 1,0,0 vertex 26 is index 26 at 1,0,0 vertex 27 is index 27 at 1,0,0 vertex 28 is index 28 at 1,0,0 vertex 29 is index 29 at 1,0,0 vertex 30 is index 30 at 1,0,-1 vertex 31 is index 31 at 0,0,-1 vertex 32 is index 32 at 0,0,-1 vertex 33 is index 33 at 0,0,-1 vertex 34 is index 34 at 0,0,-1 vertex 35 is index 35 at 0,0,-1 Triangles 0 is index 36 and for the Vertexnormals: vertex 0 is index 0 at -3.56071e-012,3.97443e-034,1.08613e-038 vertex 1 is index 1 at 1.05761e-038,1.4013e-044,-5.56616e+029 vertex 2 is index 2 at 1.34059e-005,-0,2.8026e-044 vertex 3 is index 3 at 0,0,0 vertex 4 is index 4 at 0,0,0 vertex 5 is index 5 at 0,0,0 vertex 6 is index 6 at 1.34059e-005,-9.86076e-032,1.09733e-038 vertex 7 is index 7 at 1.09865e-038,1.09866e-038,1.09868e-038 vertex 8 is index 8 at 1.0987e-038,1.09871e-038,1.09873e-038 vertex 9 is index 9 at 1.09875e-038,1.09876e-038,0 vertex 10 is index 10 at 1.34059e-005,-9.86076e-032,1.7449e-039 vertex 11 is index 11 at 1.92857e-039,2.11225e-039,2.29592e-039 vertex 12 is index 12 at 2.84694e-039,3.03062e-039,3.58164e-039 vertex 13 is index 13 at 3.76531e-039,3.94899e-039,0 vertex 14 is index 14 at 1.34059e-005,-0,3.64338e-044 vertex 15 is index 15 at 0,1.34059e-005,-0 vertex 16 is index 16 at 3.36312e-044,0,1.34059e-005 vertex 17 is index 17 at -0,3.64338e-044,0 vertex 18 is index 18 at 1.34059e-005,-0,4.48416e-044 vertex 19 is index 19 at 0,1.34059e-005,-0 vertex 20 is index 20 at 4.2039e-044,0,1.34059e-005 vertex 21 is index 21 at -0,4.48416e-044,0 vertex 22 is index 22 at 1.34058e-005,-0,5.32493e-044 vertex 23 is index 23 at 0,1.34058e-005,-0 vertex 24 is index 24 at 5.04467e-044,0,1.34058e-005 vertex 25 is index 25 at -0,5.32493e-044,0 vertex 26 is index 26 at 1.34058e-005,-0,6.16571e-044 vertex 27 is index 27 at 0,1.34058e-005,-0 vertex 28 is index 28 at 5.88545e-044,0,1.34058e-005 vertex 29 is index 29 at -0,6.16571e-044,0 vertex 30 is index 30 at 1.34058e-005,-0,7.00649e-044 vertex 31 is index 31 at 0,1.34058e-005,-0 vertex 32 is index 32 at 6.72623e-044,0,1.34059e-005 vertex 33 is index 33 at -0,7.00649e-044,0 vertex 34 is index 34 at 1.34059e-005,-0,7.84727e-044 vertex 35 is index 35 at 0,1.34059e-005,-0 Triangles 0 is index 36 What i do wrong?? Thanks for Help Markus ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21729#21729 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

