Recommended Posts

hello,
i have a mesh datastructure that consists of quads and triangles.
now i want to apply a subdivision algorithm that for the first step only creates the topological subdivision. (no vertex moving)
which algorithm is best suited for a mesh of tris+quads?
im currently thinking catmull-clark.
am i correct here:
number of new quads = 4 * quads + 3 * tris
numver of new tris = 0
and what would be the number of vertices in the new mesh? (open meshes are possible too)
thanks!

Share this post

Link to post

Share on other sites

I'd recommend not using a compact model format for subdivision. Just have a vector of Vertex structs or something, and keep pushing them back :). Then maybe after the subdivision step transfer them to a buffer for rendering.

I thought CC was just for quads? If you have quads AND triangles, you probably want a triangle subdivision scheme, which means something like loop subdivision. You can predict the number of vertices on the other side, although it becomes horribly complex if your mesh has boundaries. Just predict, based on what you know of the topology, how many times each mask will be applied. It's probably more trouble than it's worth though.

Share this post

Link to post

Share on other sites

w00f> catmull-clark subdivision scheme can be applied to ngons, not only quads and tris, you can very well use it to subdivide a mesh made out of 100-gons if you like, (instead of 3 or 4-gons (respectively tris and quads))

and what would be the number of vertices in the new mesh? (open meshes are possible too)

you will need more information than just the initial number of faces and vertices to do this, especially if your mesh isn't closed, or has duplicate vertices (if you want to handle whatever per-vertex data discontinuity, like hard edges on your surface (normal discontinuity), or texcoords discontinuities (almost unavoidable for most closed textured meshes))

the number of output vertices can be computed with:n_verts = vc + ec + fc

where vc is your vertex count, ec your edge count, and fc your face count before subdivision.you keep each vertex, you subdivide each edge (each edge will generate a vertex at its midpoint), and you add a vertex at the centroid of each face.