Hi Robert,

Robert Osfield wrote:
I'm afraid I can't work out the failure mechanism just be reading
email.  Could you provide a small code example program that could be
compiled to show the problem you are seeing.
Here you go. The stripped down example might not make a lot of sense, so if you want I can try to explain why I'm trying to do things this way.

Paul
#include <osgViewer/Viewer>
#include <osg/MatrixTransform>
#include <osg/Geode>
#include <osg/Geometry>

class MyTransform : public osg::MatrixTransform
{
public:
    MyTransform()
    {
        m_geom = new osg::Geometry;
        m_geom->setUserData(this);

        osg::Geode *geode = new osg::Geode;
        geode->addDrawable(m_geom.get());

        m_geom_transform = new osg::MatrixTransform;
        m_geom_transform->addChild(geode);
        addChild(m_geom_transform.get());
    }

protected:
    osg::ref_ptr<osg::Geometry>             m_geom;
    osg::ref_ptr<osg::MatrixTransform>      m_geom_transform;
};

int main()
{
    MyTransform* mt = new MyTransform;

    osgViewer::Viewer v;
    v.setSceneData(mt);
    v.run();
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to