thank you for advise . As Resume here my working code: 

Code:
    osg::Geometry* linesGeom = new osg::Geometry();// is my geometry 
    osg::DrawArrays* drawArrayLines = new 
osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP); 
    linesGeom->addPrimitiveSet(drawArrayLines);
    osg::Vec3Array* vertexData = new osg::Vec3Array;
    linesGeom->setVertexArray(vertexData);
    
    
    osg::ref_ptr<osg::Geode> tmp_geode (new osg::Geode);// Greate test Geode
    tmp_geode->addDrawable(linesGeom);
    nazemTargetPathGroup->addChild(tmp_geode);// add geode to my osg::Group
   
    // ADD SOME VERTEX
    
    vertexData->push_back(osg::Vec3(0,0,0));
    vertexData->push_back(osg::Vec3(0,0,5000));
    vertexData->push_back(osg::Vec3(10000, 10000, 10000));
    vertexData->push_back(osg::Vec3(-10000, -10000, -10000));
    vertexData->push_back(osg::Vec3(-10000, 300, -10000));
    
    drawArrayLines->setFirst(0);
    drawArrayLines->setCount(vertexData->size());
    
    // NOW ADD NEW VERTEX:
    
    vertexData->push_back(osg::Vec3(100, 300, -10000));
    
    drawArrayLines->setFirst(0);
    drawArrayLines->setCount(vertexData->size());



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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to