qertks.blogg.se

Dmesh algorithm
Dmesh algorithm




We can do a lot with just the basic indexed mesh, and it is the most memory-efficient mesh representation. If we want to animate the mesh, we can modify the vertices. If we want to estimate vertex normals, we can iterate over the triangles and accumulate their facet normals at the vertices. For example to render the triangles we just need the vertices of each triangle. Then, each triangle is an integer 3-tuple (a,b,c), where each integer is the index of one of the vertices.įor many mesh processing tasks, this is all we really need. In DMesh3 we store these in double-precision floating point. Each vertex is a triplet or 3-tuple of real values (x,y,z) which are the 3D coordinates. The diagram below shows how these things connect up.

dmesh algorithm

For example, Unity's Mesh class is also an indexed mesh, and the vertex buffers you might pass to a low-level graphics API like OpenGL/Direct3D/Vulkan/Metal are indexed meshes. This is similar to the basic mesh data structures used in many other libraries. This means that we reference components of the mesh - ie the vertices and triangles - by integer indices, rather than pointers. Along the way I will try to explain some of the central concepts of triangle mesh data structures, which should also apply to other triangle mesh libraries.Īt its core, DMesh3 is an index-based triangle mesh. In this post I will dive into the details of this data structure and the operations it provides.

dmesh algorithm

If so, then the triangle mesh data structure is kind of important! In g3Sharp, this is the DMesh3 class. If you are using the g3Sharp library, there is a good chance it's because you need to do some things with triangle meshes.






Dmesh algorithm