Paul Martz wrote :
>When you first set up your line strip, you only put one vertex in it, so I 
>wouldn't expect anything to be drawn until you add an additional vertex. 

>You have set your color binding to be BIND_PER_VERTEX and you have >one color 
>in the color array. Initially (when you only have one vertex) this is OK. 
>But as soon as you add more vertices, you do not also add more colors, >so 
>this could potentially cause a crash if OSG or OpenGL tries to index off >the 
>end of you color array. 

When I add new vertex , I add a new color for this vertex:
colors->push_back(osg::Vec4(color.red(),color.green(),color.blue(),
color.alphaF()));

Look this code :

// ADD NODE

void TglLine::addNode(float X,float Y,float Z, QColor color){

vertexData->push_back(osg::Vec3(X,Y,Z));
colors->push_back(osg::Vec4(color.red(),color.green(),color.blue(),
color.alphaF()));
drawArrayLines->setFirst(0);
int i =vertexData->size();
drawArrayLines->setCount(i);
linesGeom->dirtyBound();



}



//HERE my call

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10376#10376





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to