<div dir="ltr"><div>Hi,</div><div><br></div><div>I don't think you should call   _geom->setUseVertexBufferObjects(true); here. I bet the flt plugin is setting this on creation time. If you have a use case code you can share and the model it will help more for me to see what is going on<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 20, 2019 at 10:19 AM Dae Woo Ryu <<a href="mailto:osgforum@tevs.eu">osgforum@tevs.eu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">hi NICK.<br>
Thank you for your reply.<br>
<br>
I did what you tried and nothing changed.<br>
Can you tell me another way?<br>
<br>
Here is the code I did.<br>
<br>
Code:<br>
<br>
virtual void operator()(osg::Node*, osg::NodeVisitor* nv)<br>
{               <br>
        if (nv->getFrameStamp())<br>
        {               <br>
                if (_coord)<br>
                {<br>
                        for (unsigned int u = 0; u < _coord->size(); u++)<br>
                        {<br>
                                _coord->at(u).x() += 0.6f;<br>
                                _coord->at(u).y() += 0.6f;<br>
                                _coord->dirty();<br>
                        }<br>
                        _geom->setUseVertexBufferObjects(true);<br>
                        _coord->getBufferObject()->dirty();<br>
                }<br>
        }<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
Trajce Nikolov NICK wrote:<br>
> <br>
> You may need to call _coord->getBufferObject()->dirty() and do it outside of the for loop<br>
> <br>
> On Wed, Sep 18, 2019, 02:34 Dae Woo Ryu < ()> wrote:<br>
> <br>
> <br>
> > hi Laurens.<br>
> > Thank you for the your reply.<br>
> > <br>
> > I've tried adding dirty() and it still doesn't work.<br>
> > <br>
> > Code:<br>
> > <br>
> > virtual void operator()(osg::Node*, osg::NodeVisitor* nv)<br>
> > {<br>
> >         if (nv->getFrameStamp())<br>
> >         {       <br>
> >                 _coord = dynamic_cast<osg::Vec2Array*>(_geom->getTexCoordArray(0));<br>
> > <br>
> >                 if (_coord)<br>
> >                 {<br>
> >                         for (unsigned int u = 0; u < _coord->size(); u++)<br>
> >                         {<br>
> >                                 _coord->at(u).x() += 0.01f;<br>
> >                                 _coord->at(u).y() += 0.01f;<br>
> >                                 _coord->dirty();<br>
> >                                 _geom->dirtyDisplayList();<br>
> >                         }<br>
> >                 }<br>
> >         }<br>
> > }<br>
> > <br>
> > <br>
> > <br>
> > What should I do more?<br>
> > <br>
> > <br>
> > Voerman, L. wrote:<br>
> > <br>
> > > Hi Dae,add _coord->dirty()<br>
> > > after modification.<br>
> > > Laurens. <br>
> > > <br>
> > > <br>
> > > <br>
> > > <br>
> > > On Tue, Sep 17, 2019 at 3:16 AM Dae Woo Ryu < ()> wrote:<br>
> > > <br>
> > > <br>
> > > <br>
> > > > Hi,<br>
> > > > <br>
> > > > As shown in the code below, <br>
> > > > I get the geometry information from the model of Openflight(.flt) format and move the coordinates of the vertices.<br>
> > > > But the texture doesn't move.<br>
> > > > How can I move a texture?<br>
> > > > <br>
> > > > **main**<br>
> > > > <br>
> > > > <br>
> > > > Code:<br>
> > > > <br>
> > > > ...<br>
> > > > osg::ref_ptr<osg::Node> model = osgDB::readNodeFile("test/env_cloud.flt");<br>
> > > > <br>
> > > > coneUpdateVisitor coneV;<br>
> > > > model->accept(coneV);<br>
> > > > <br>
> > > > scene->addChild(model);<br>
> > > > ...<br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > **visitor**<br>
> > > > <br>
> > > > Code:<br>
> > > > <br>
> > > > <br>
> > > > class coneUpdateVisitor : public osg::NodeVisitor<br>
> > > > {<br>
> > > > ...<br>
> > > > <br>
> > > > void apply(osg::Geode& geode)<br>
> > > > {<br>
> > > >         for (unsigned int i = 0; i<geode.getNumDrawables(); ++i)<br>
> > > >         {<br>
> > > >         scene->setUpdateCallback(new coneUpdateCallback(geode.getDrawable(i)->asGeometry()));<br>
> > > >         }<br>
> > > > }<br>
> > > > }<br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > **callback**<br>
> > > > <br>
> > > > <br>
> > > > Code:<br>
> > > > <br>
> > > > class coneUpdateCallback : public osg::NodeCallback<br>
> > > > {<br>
> > > > ...<br>
> > > > _geom->setUseDisplayList(false);<br>
> > > > ...<br>
> > > > <br>
> > > > virtual void operator()(osg::Node*, osg::NodeVisitor* nv)<br>
> > > > {<br>
> > > >         if (nv->getFrameStamp())<br>
> > > >         {<br>
> > > >                 _coord = dynamic_cast<osg::Vec2Array*>(_geom->getTexCoordArray(0));<br>
> > > > <br>
> > > >                 for (unsigned int u = 0; u < _coord->size(); u++)<br>
> > > >                 {<br>
> > > >                         _coord->at(u).x() += 0.01f;<br>
> > > >                 }<br>
> > > > <br>
> > > >         }<br>
> > > > }<br>
> > > > }<br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > Thank you!<br>
> > > > <br>
> > > > Cheers,<br>
> > > > Dae<br>
> > > > <br>
> > > > ------------------<br>
> > > > Read this topic online here:<br>
> > > > <a href="http://forum.openscenegraph.org/viewtopic.php?p=76684#76684" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76684#76684</a> (<a href="http://forum.openscenegraph.org/viewtopic.php?p=76684#76684" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76684#76684</a>) (<a href="http://forum.openscenegraph.org/viewtopic.php?p=76684#76684" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76684#76684</a> (<a href="http://forum.openscenegraph.org/viewtopic.php?p=76684#76684" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76684#76684</a>))<br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > _______________________________________________<br>
> > > > osg-users mailing list<br>
> > > >   ()<br>
> > > > <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a> (<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>) (<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a> (<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>))<br>
> > > > <br>
> > > > <br>
> > > <br>
> > > <br>
> > >   ------------------<br>
> > > Post generated by Mail2Forum<br>
> > > <br>
> > <br>
> > <br>
> > ------------------<br>
> > Read this topic online here:<br>
> > <a href="http://forum.openscenegraph.org/viewtopic.php?p=76688#76688" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76688#76688</a> (<a href="http://forum.openscenegraph.org/viewtopic.php?p=76688#76688" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76688#76688</a>)<br>
> > <br>
> > <br>
> > <br>
> > <br>
> > <br>
> > _______________________________________________<br>
> > osg-users mailing list<br>
> >  ()<br>
> > <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a> (<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>)<br>
> > <br>
> <br>
> <br>
>  ------------------<br>
> Post generated by Mail2Forum<br>
<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=76719#76719" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76719#76719</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">trajce nikolov nick<br></div>