Closed chukcha2 closed 2 years ago
I used this project for my meshes that have color information supplied in the vertices. All you have to do is add a Vec3 after the position and average the two vertex colors when collapsing an edge. There's also a function called compact_mesh
that copies vertices, so you have to make it copy the color info too. You really only end up adding like 4 lines to the code and the simplification retains all color info perfectly.
@Lin20 your solution is a good one. Since this message was posted, the repository has been updated to track OBJ format texture coordinates. The TEXCOORD attribute could provides a template for how to handle per-vertex colors. In other words, the TEXCOORDs intepolate across a 2D texture (u,v), while for vertex colors you will want to interpolate the Red, Green and Blue components (r,g,b).
Hello, Some applications (like meshlab) append rgb values to vertex lines. From wikipedia:
When I tried the tool with obj file with vertex color, the output obj lost the color. Would it be possible to enhance the tool to keep vertex color?