<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hi all,<br>
<br>
I was hunting a long time for some strange effect. I discovered the
reason but have some understanding issues.<br>
Why is Code 1 not working but code 2? I would prefer Code 1 because
of less data. <br>
<br>
<font color="#400040">Code 1) (my original code is not working)<br>
</font><font color="#400040"> </font><font face="monospace"><font
face="monospace"> osg::ref_ptr<osg::IntArray>
osgVertexFlagsVector; <br>
<br>
</font> osgVertexFlagsVector = new osg::IntArray(1);<br>
</font><font face="monospace"><font face="monospace">
osgVertexFlagsVector->setBinding(osg::Array::BIND_OVERALL);<br>
</font></font><font face="monospace"><font face="monospace">
_geometry->setVertexAttribArray(VERTEX_FLAGS_ATR_UNIT,
osgVertexFlagsVector.get(), osg::Array::BIND_OVERALL);<br>
</font>
</font>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
<font face="monospace"> (*osgVertexFlagsVector)[0] =
VERTEX_FLAG_VISIBLE;</font><br>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
Code 2) (this code is working)<br>
<span style=" color:#c0c0c0;"><span style=" color:#c0c0c0;"> </span></span><font
face="monospace"> osg::ref_ptr<osg::IntArray>
osgVertexFlagsVector;
<br>
<br>
</font><font face="monospace"> osgVertexFlagsVector = new
osg::IntArray(numVertices);<br>
osgVertexFlagsVector->setBinding(osg::Array::BIND_PER_VERTEX);
<br>
_geometry->setVertexAttribArray(VERTEX_FLAGS_ATR_UNIT,
osgVertexFlagsVector.get(), osg::Array::BIND_PER_VERTEX);<br>
<br>
for (auto i=0; i<numVertices; i++)<br>
(*osgVertexFlagsVector)[i] = VERTEX_FLAG_VISIBLE;<br>
</font><br>
Many thanks in advance<br>
<br>
- Werner -<br>
</body>
</html>