[osg-users] Scaling visitor not working as expected

Christian Buchner christian.buchner at gmail.com
Tue Jan 9 08:57:30 PST 2018


Are display lists active in your scene? if so, maybe a dirtyDisplayList()
call might be required
on the affected drawables.

drawable->dirtyDisplayList()

As far as I know display lists are still the default in OSG, unless you
explicitly disable them on
geometry objects (and possibly enable vertex buffer objects instead, for
performance reasons)

the corresponding API calls on drawables would be

drawable->setUseDisplayList( false )
drawable->setUseVertexBufferObjects( true )

you could use a visitor right after loading the scene to switch off display
lists and enabling
vertex buffer objects instead.

Christian


2018-01-09 14:58 GMT+01:00 Werner Modenbach <Werner.Modenbach at texion.eu>:

> 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 -
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180109/29c2825b/attachment-0001.html>


More information about the osg-users mailing list