<div dir="auto"><div>You may need to call _coord->getBufferObject()->dirty() and do it outside of the for loop<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 18, 2019, 02:34 Dae Woo Ryu <<a href="mailto:osgforum@tevs.eu">osgforum@tevs.eu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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>
> 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>
> > 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 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 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 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 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=76688#76688" rel="noreferrer 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>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank" rel="noreferrer">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div></div></div>