Fixed the compile problem....
numElements = v2da->getNumElements();
for(int nElement = 0; nElement < numElements; nElement++) {
osg::Vec2d dataPoint = (*v2da->getDataPointer())[nElement];
}
But the osg::Vec2d dataPoint = (*v2da->getDataPointer())[nElement];
causes and exception
What is the correct way to retrieve my data from Vec2dArray?
Ed
Ed wrote:
I am trying to use osg::Vec2dArray as follows...
osg::ref_ptr<osg::Vec2dArray> v2da = new osg::Vec2dArray;
v2da->push_back( osg::Vec2d(1.0, 2.0) );
v2da->push_back( osg::Vec2d(3.0, 4.0) );
v2da->push_back( osg::Vec2d(5.0, 6.0) );
which I think is correct, but I am not clear as to how to get my data
back out....
I tried this:
numElements = v2da->getNumElements();
for(int nElement = 0; nElement < numElements; nElement++) {
osg::Vec2d dataPoint = v2da->getDataPointer()[nElement];
}
but get a compile error.
Ed
_______________________________________________
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