Hello everyone,
I am loading and displaying a tetrahedral mesh consisting of a list of
verticies and a list of tetrahedrons denoted by four indices of
vertices. I load these into a triangles primitive set as four triangles,
one for each of the faces of the tetra.
My first question is, is this method of representing a mesh inefficient?
There are two GL_TRIANGLEs for each of the interior triangles. The
performance seems to be fine. I have looked into libraries like VCG and
OpenMesh, but chose not to use them as I will need to only display and
select from the mesh, and no manipulation is needed. Also, I could not
figure out how to represent a VCG or OpenMesh mesh in a osg::Geometry.
One way to view the mesh in my application is as a solid. My second
question is how can I prevent this sort of effect from occurring (see
attached, or http://i.imgur.com/1t4xWy9.png)? I use a SmoothingVisitor
to set normals (and shading mode is set to flat), and since they are set
per vertex the normals do not point directly outwards. I've read around
the mailing list and it seems using BIND_PER_PRIMITIVE normal binding is
deprecated and slow. It was also mentioned to duplicate vertex entries
and set different normals like that, but I don't see how this would work
on a mesh that is being imported and built on the fly.
Thank you,
Radu
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org