[osg-users] UpdateCallback
Julie Green
laroux92 at mail.ru
Wed Aug 26 06:41:49 PDT 2015
Code:
void UpdateSurfaceCallback::operator()(osg::Node *node, osg::NodeVisitor *nv)
{
osg::Geometry* geometry = node->asGeometry();
osg::Array* vertices;
if (geometry)
{
vertices = geometry->getVertexArray();
int N = vertices->getNumElements();
osg::Vec3Array *array = new osg::Vec3Array(N);
array = dynamic_cast<osg::Vec3Array*>(vertices);
for (int i = 0; i < N; i++)
{
delta = ((*vertexArray)[i].z() - (*array)[i].z()) / 1000;
dz = (*array)[i].z() + delta*c;
(*array)[i].set(osg::Vec3f((*array)[i].x(), (*array)[i].y(), dz));
}
c++;
}
traverse(node, nv);
};
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64905#64905
More information about the osg-users
mailing list