[osg-users] Scaling visitor not working as expected

Werner Modenbach Werner.Modenbach at texion.eu
Tue Jan 9 05:58:31 PST 2018


Hi all,

I'm loading 3ds scenes as subnodes into my scene. The 3ds coordinates
are in a different scale than my scene.
Usually I would solve this by a transform. But because of internal
reasons I need the vertices being
in MY coordinate measure.
So I wrote a scaling visitor, that multiplies al vertices of geometries
by a given factor.
That works perfectly fine when loading the 3ds scene:
/       
osg::ref_ptr<osg::Node//>////node////=////osgDB//::readRefNodeFile(//path//);
//
////       
ScaleVisitor////sv(//initialObjectScale////*////correctiveObjectScale//); //
//        //node->//accept//(sv); //
//        //addChild//(node); //
/
Unfortunately when rescaling the object after being added as a child
this doesn't work any more:
/        osg::ref_ptr<osg::Node> node////=////getChild(0);////
//        ScaleVisitor////sv(scaleChange);//
        //node->accept(sv);/

The 3ds scene doesn't change size on my screen.
The visitor calls:
        vertices->dirty();
        geom.dirtyBound();

But nothing happens. What am I missing? Deleting the 3ds scene and
recreating it from scratch works OK but is very inefficient.

Thanks for any hint.

- Werner -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180109/f4d8b7ed/attachment.html>


More information about the osg-users mailing list