Show
Ignore:
Timestamp:
09/15/05 22:03:37 (9 years ago)
Author:
robert
Message:

Added line connectivity code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgspheresegment/osgspheresegment.cpp

    r4512 r4525  
    338338    if (!lines.empty()) 
    339339    { 
    340        osg::notify(osg::NOTICE)<<"We've found intersections!!!!"<<std::endl; 
     340        osg::notify(osg::NOTICE)<<"We've found intersections!!!!"<<std::endl; 
     341 
     342        osg::Geode* geode = new osg::Geode; 
     343        root->addChild(geode); 
     344 
     345        geode->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF); 
     346 
     347        for(osgSim::SphereSegment::LineList::iterator itr=lines.begin(); 
     348           itr!=lines.end(); 
     349           ++itr) 
     350        { 
     351            osg::Geometry* geom = new osg::Geometry; 
     352            geode->addDrawable(geom); 
     353             
     354            osg::Vec3Array* vertices = itr->get(); 
     355            geom->setVertexArray(vertices); 
     356            geom->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP, 0, vertices->getNumElements())); 
     357        } 
    341358    } 
    342359    else