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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org