Alberto Luaces wrote:
"Sasha Koruga" writes:
Hey,
I was wondering if OSG has the built-in functionality to reduce the vertex
count of a mesh to a programmer-specified amount. For example, if I have a
125,000 vertex model of an airplane, can I call some function like
reduce(airplane, 100000), that will reduce the vertex count of that mesh to
100000 while doing its best to maintain the mesh's general shape?
Hi Sasha,
take a look at the osgsimplifier example.
In addition to the osgUtil::Simplifier in OSG, you might want to look at a
couple external projects.
osgWorks (osgworks.googlecode.com) has two additional vertex reduction
techniques. One ("Decimator") is based on the Simplifier and attempts to
compensate for the Simplifier's inability to remove vertices that fall on an
edge. The other ("Reducer") employs a different algorithm entirely. It produces
good results and is very fast, but currently has limitations regarding which
primitive types it works with. osgWorks comes with a script that lets you run
these reduction techniques on various models and compare the results
side-by-side visually.
osgBullet (osgbullet.googlecode.com) also has a vertex reduction algorithm
called "VertexAgg". It aggregates nearby vertices together, then uses Bullet to
create a convex hull around the vertices. The result is very approximate, and
doesn't contain normals or tex coords, but it's good enough for creating physics
collision shapes for complex objects (which is what it was intended for).
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org