Re: [osg-users] Access vertices and faces after load the model

2009-05-29 Thread Xin Chen
Hello Guys, To my original problem. I found a website which is quite useful and works. Just in case others may need it. http://delta3d.wiki.sourceforge.net/Accessing+Underlying+OpenSceneGraph+Geometry Thank you! Cheers, Xin -- Read this topic online here: http://forum.o

Re: [osg-users] Access vertices and faces after load the model

2009-05-29 Thread Thrall, Bryan
Paul Melis wrote on Friday, May 29, 2009 9:55 AM: > Thrall, Bryan wrote: >> Paul Martz wrote on Thursday, May 28, 2009 4:50 PM: >> >>> You use a NodeVisitor to walk your scene graph and look for Geodes, >>> then iterate over the Drawables that are attached to the Geodes, using >>> dynamic_cast to

Re: [osg-users] Access vertices and faces after load the model

2009-05-29 Thread Paul Martz
Touché! :-) Cheers, Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Thrall, Bryan Paul Martz wrote on Thursday, May 28, 200

Re: [osg-users] Access vertices and faces after load the model

2009-05-29 Thread Paul Melis
Thrall, Bryan wrote: Paul Martz wrote on Thursday, May 28, 2009 4:50 PM: You use a NodeVisitor to walk your scene graph and look for Geodes, then iterate over the Drawables that are attached to the Geodes, using dynamic_cast to access the Drawable as a Geometry. Even better, I notice o

Re: [osg-users] Access vertices and faces after load the model

2009-05-29 Thread Thrall, Bryan
Paul Martz wrote on Thursday, May 28, 2009 4:50 PM: > You use a NodeVisitor to walk your scene graph and look for Geodes, > then iterate over the Drawables that are attached to the Geodes, using > dynamic_cast to access the Drawable as a Geometry. Even better, I notice osg::Drawable has asGeometry

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Paul Martz
Just to kind of sum up what has been said here... To get the vertices and other vertex attributes, you use get* methods in the Geometry class. See the Geometry header file. There could be dozens, possibly thousands of Geometry objects in your scene graph. You use a NodeVisitor to walk your scene

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Chris 'Xenon' Hanson
Xin Chen wrote: >Thanks for your reply. I did look at the source code to load .stl > models. I found that there are _vertices and _normal variables in the source > code. That's why I'm asking if there is a way to access those parameters. Any > idea or sample code? Thank you. I think

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Jason Daly
Jason Daly wrote: If you really do need to get at the low-level data, you can use the NodeVisitor method I described previously. You'll need to create a class that inherits from osg::NodeVisitor and overrides the apply(Geometry *) method to perform whatever operations you need on each Geometr

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Xin Chen : > Hello Ismail, > >       Thanks for your reply. I did look at the source code to load .stl > models. I found that there are _vertices and _normal variables in the source > code. That's why I'm asking if there is a way to access those parameters. Any > idea or sample code? T

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Jason Daly
Xin Chen wrote: Thank you for the reply. I do need the vertices and faces. My application is to load CAD model and simulate the projection (X-ray image) of the model according to the materials. So the ability to access individual vertices are important for my application. Any easy ways

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Xin Chen
ismailp wrote: > 2009/5/28 Xin Chen <>: > > > Hi, > > > >    I'm new to OSG. I use the following code to load my model, which is > > successful.  How can I access the vertices and faces of the model? Thank > > you. > > > > nNode = osgDB::readNodeFile("D:/Livingroom.3DS"); > > > > > > > >

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Xin Chen
Jason Daly wrote: > Xin Chen wrote: > > > Hi, > > > > I'm new to OSG. I use the following code to load my model, which is > > successful. How can I access the vertices and faces of the model? Thank > > you. > > > > nNode = osgDB::readNodeFile("D:/Livingroom.3DS"); > > > > > > Access them

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Xin Chen : > Hi, > >    I'm new to OSG. I use the following code to load my model, which is > successful.  How can I access the vertices and faces of the model? Thank you. > > nNode = osgDB::readNodeFile("D:/Livingroom.3DS"); > > > > > > Thank you! > > Cheers, > xinchen > > -

Re: [osg-users] Access vertices and faces after load the model

2009-05-28 Thread Jason Daly
Xin Chen wrote: Hi, I'm new to OSG. I use the following code to load my model, which is successful. How can I access the vertices and faces of the model? Thank you. nNode = osgDB::readNodeFile("D:/Livingroom.3DS"); Access them for what purpose? When your model is loaded, a scene