How can i get the list of geometry of a shape #1212
-
Hello I want to know how can i get the osg::Geometry of a shape ?? like osg::Cone for example. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The osg::Shape implementations don't have a osg::Geometry so you can "get" one from it. The osg::Shape are just primitive shape definitions that don't have any additional functionality built-in. In order to be render a shape you need to use a osg::ShapeDrawable, but this isn't what you asked, perhaps what you meant. Look at the osgshape example. |
Beta Was this translation helpful? Give feedback.
-
Hello I want to use the project osgModeling with osg::ShapeDrawable but i need osg::Geometry for that, i start with TriangleFunctor for duplicate the facets of a cone to do a Boolean Operator with a Box but i have this result : my code :
// i use vector array to get every Vec3 of facets of Box and Cone `struct FaceCollectorCone struct FaceCollectorCube // in the main fonction : shapeCone->setShape(coneModel); osg::TriangleFunctor functor; osg::ref_ptrosg::Box cubeModel = new osg::Box(osg::Vec3f(0., 0., 9.), 5); shapeCube->setShape(cubeModel); osg::TriangleFunctor functorCube; it's look like the Cone have too much Vec3 in my vector array. |
Beta Was this translation helpful? Give feedback.
-
I am not familiar with the osgModelling library so can't help with this. Looking at osg::ShapeDrawable in the OSG-3.6 branch, it subclasses from osg::Geometry so you should be able to just query it directly for it's vertex and primitive data. |
Beta Was this translation helpful? Give feedback.
The osg::Shape implementations don't have a osg::Geometry so you can "get" one from it. The osg::Shape are just primitive shape definitions that don't have any additional functionality built-in.
In order to be render a shape you need to use a osg::ShapeDrawable, but this isn't what you asked, perhaps what you meant. Look at the osgshape example.