Hi Robert,
My problem is that when I load the entire file.ply, the rendering has
a good frame rate, but the loading time take a long while (hours)...
hardware: nvidia quadro FX 3500M, RAM 2Gb
osg version 2.2.0
file dimension (.ply) is about 250Mb (6.000.000 points; 12.000.000 triangles)
My own ply loader is very simple, it reads in file.ply and loads
vertices and faces in geometry class:
osg::ref_ptr<Geode> geode = new osg::Geode();
osg::ref_ptr<Geometry> geometry = new osg::Geometry();
geode->addDrawable(geometry.get());
osg::ref_ptr<Vec4Array> colors=new osg::Vec4Array();
osg::ref_ptr<Vec3Array> verices = new osg::Vec3Array;
geometry->setVertexArray( vertices.get() );
geometry->setColorArray(colors.get());
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
for(i=0;i<n_vertices;i++)
{
read from file in x y z r g b
vertices->push_back( osg::Vec3( x, y, z) );
colors->push_back(osg::Vec4(r,g,b,1.0f));
}
for(i=0;i<n_faces;i++)
{
read from file the connection list in index1 index2 index3
osg::ref_ptr<DrawElementsUInt> face=new osg::DrawElementsUInt
(osg::PrimitiveSet::TRIANGLES, 0);
face->push_back(index1);
face->push_back(index2);
face->push_back(index3);
geometry->addPrimitiveSet(face.get());
}
However I'll try to follow your advices (using vbo) as soon as I can
Thanks
2008/4/21, Robert Osfield <[EMAIL PROTECTED]>:
> Hi Fabio,
>
> You say the problem fails.. but in what way?
>
> What hardware, OS, OSG versions are you working with?
>
> The OSG doesn't have a ply loader itself, is this your own loader.
>
> As for techniques for handling large models, I'd suggest switching off
> display lists, and then breaking the model down into smaller geometry
> blocks, of something like 10,000 vertices/triangles each and use
> VBO's.
>
> Robert.
>
> On Mon, Apr 21, 2008 at 3:35 PM, fabio riot <[EMAIL PROTECTED]> wrote:
> > Hi all
> > I'm new in OSG, so I need some advices to address my work.
> > I need to visualize a large dimension laser scanner file (.ply).
> > it contains about 6.000.000 of points and 12.000.000 of triangles
> > (point's connections).
> > I'm not able to view the entire file with a single node scenegraph
> > (the program fails):
> >
> >
> > osg::Node* node = NULL
> > node = osgDB::readNodeFile("entire_file.ply"); //with my plugin
> > osg::ref_ptr<osg::Group> root = new osg::Group();
> > root->addChild(node);
> > viewer....etc
> >
> >
> > So I have broken the "laser cloud" in more little pieces
> > (at example 12 pieces each one with 500.000 points and about 1.000.000
> > triangles)
> > and I have created a scenegraph with 12 node
> >
> >
> > osg::ref_ptr<osg::Group> root = new osg::Group();new osg::Group();
> > root->addChild(node1);
> > root->addChild(node2);
> >
> > .....
> >
> > root->addChild(node12);
> >
> > where each node contains one pieces of data
> >
> > In this way I can load and view the all strucure...but the loading
> > time is very very long (60 min)
> >
> > I'would like to know if this is the correct way to tackle my problem
> > or if there's a clever way...Thanks
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org