Hi,
I am reading the points from LAS file and rendering the data. The data is not
dynamically updated. I am pasting the subset fo code. So that you can find out
how I am rendering the points...
for(unsigned long k = 1; k < no_points; k ++)
{
lasVertices->push_back( osg::Vec3( x_coord, y_coord, z_coord));
}
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) );
lasGeometry->setVertexArray( lasVertices);
lasGeometry->setColorArray(colors);
lasGeometry->setColorBinding(osg::Geometry::BIND_OVERALL);
for(prim = 0 ; prim < no_points-1; prim = prim + 1)
{
lasPrim = new osg::DrawElementsUInt(osg::PrimitiveSet::POINTS);
lasPrim -> push_back(prim);
lasGeometry->addPrimitiveSet(lasPrim);
}
//lasGeometry->addPrimitiveSet(lasPrim);
osg::ref_ptr<osg::StateSet> state = root->getOrCreateStateSet();
state->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
//osg::PolygonMode* pm = new
osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE );
// Force wireframe rendering.
//state->setAttributeAndModes( pm, osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE );
viewer.setSceneData( root );
viewer.addEventHandler( new PickHandler );
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
viewer.run();
viewer.realize();
while( !viewer.done() )
{
viewer.frame();
}
Thank you!
Cheers,
Vipin
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33196#33196
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org