Re: [osg-users] Scaling visitor not working as expected

2018-01-09 Thread Christian Buchner
I just checked a recent osg::Drawable header file and it seems
dirtyDisplayList() is deprecated
and has been replaced with dirtyGLObjects(). Relevant snippet follows:

#ifdef OSG_USE_DEPRECATED_API
/** Deprecated, use dirtyGLObjects() instead. */
inline void dirtyDisplayList()
{
dirtyGLObjects();
}
#endif

/** Force a recompile on next draw() of any OpenGL objects associated with
this geoset.*/
virtual void dirtyGLObjects();


2018-01-09 17:57 GMT+01:00 Christian Buchner :

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


Re: [osg-users] Scaling visitor not working as expected

2018-01-09 Thread Christian Buchner
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 :

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


[osg-users] Scaling visitor not working as expected

2018-01-09 Thread Werner Modenbach
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_ptrnode=osgDB//::readRefNodeFile(//path//);
//
       
ScaleVisitorsv(//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 node=getChild(0);
//        ScaleVisitorsv(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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org