I have a set of squares (pixels coming in from an image) that I want to triangulate.
I narrowed my choices down to 2 possible routes:
- A, breaking the squares into lager rectangles, or
- B, generating a set of vertices and triangulating them.
B is better, as it generates fewer vertices.
I'm dumb, and couldn't find a way to implement route A. But oddly enough, I found it simpler go with route B and generate the vertices. I'm checking neighbor pixels and using a simple lookup table to determine where to place a vertex. That is done and easy.
But with that collection of vertices, I'm stuck. It might contain holes, or be composed of multiple islands of polygons. So from there, I don't know where to go. Any ideas?
Also, if it makes any difference, I'm using these triangulated images to build up a voxel mesh, marching through the voxel data in 6 directions and looking at it in cross sections. At the end, I'll piece them all back together. It's kind of similar to the "trixels" used in Fez.