Hi Nitin? NRangari? Could you sign with your first name so we know how to address you thanks.
As for the lack in any mesh rendering well it kinda looks like you aren't doing anything to rendering, you just have a disconnected bunch of variables that have no relation to the based class. I'm pretty perplexed that you are expecting anything to happen. I am also perplexed that you are trying to subclass from osg::TriangleMesh and to use osg::ShapeDrawable. Is there are reason why you are trying to use the shape primitives in this way? The Shape's are intended to provide a primitive description for physics/collision detection and not for rendering. The ShapeDrawable is there for convenience, it's certainly not a general purpose rendering class. Might I recommend you look at the osg::Geometry class for rendering meshes, please have a look at the osggeometry example. Robert. On Wed, Apr 14, 2010 at 3:15 PM, Nitin Rangari <[email protected]> wrote: > I have created class AXConvexHull derive from osg::TriangleMesh > class AXConvexHull:public osg::TriangleMesh > { > public: > public: > > AXConvexHull() {} > /* AXConvexHull(const AXConvexHull& mesh,const CopyOp& > copyop=CopyOp::SHALLOW_COPY): > Shape(mesh,copyop), > _vertices(mesh._vertices), > _indices(mesh._indices) {} > META_Shape(osg, AXConvexHull);*/ > > void setVertices(osg::Vec3Array* vertices) { _vertices = vertices; } > osg::Vec3Array* getVertices() { return _vertices.get(); } > const osg::Vec3Array* getVertices() const { return _vertices.get(); > } > > void setIndices(osg::IndexArray* indices) { _indices = indices; } > osg::IndexArray* getIndices() { return _indices.get(); } > const osg::IndexArray* getIndices() const { return _indices.get(); } > > void setNormals(osg::Vec3Array* normals) { _normals = normals; } > osg::Vec3Array* getNormals() { return _normals.get(); } > protected: > > virtual ~AXConvexHull(){} > osg::ref_ptr<osg::Vec3Array> _vertices; > osg::ref_ptr<osg::IndexArray> _indices; > osg::ref_ptr<osg::Vec3Array> _normals; > }; > but when i do > > osg::ref_ptr<osg::Geode> geode=new osg::Geode(); > adaptive3d::AXGraphicsMesh* patch =dynamic_cast<AXGraphicsMesh*>(gObject); > if(patch!=NULL) > { > myMesh->setIndices(patch->getIndicesData()); > myMesh->setVertices(patch->getVerticesData()); > myMesh->setNormals(patch->getNormalData()); > } > currentShapeDrawable = new osg::ShapeDrawable(myMesh); > geode->addDrawable(currentShapeDrawable); > rootgNode->addChild(geode.get()); > its not showing anything > . > _______________________________________________ > 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

