0

I'm using OpenMesh to remesh/manage some mesh objects. With subdivide/decimate/smooth and other tools from OpenFlipper, I can change the mesh topology.

This however results in vertex colors loosing their meaning, as new vertices will all have black color and there is no interpolation when mesh topology changes, resulting in visual artifacts.

Is there a way to tell OpenMesh to reproject vertex colors back to the old mesh to interpolate the vertex color? If not, what would be a good way to do it manually? Is there any state of the art for vertex back-projection?

Lake
  • 4,072
  • 26
  • 36

2 Answers2

2

In OpenFlipper using requestTriangleBsp() you can request a BSP tree for your original mesh object. (You will have to keep a copy of your original mesh as long as you want to use that BSP tree.) Whenever you want to project a point onto your original mesh, you can then use the nearest() member function on the BSP tree in order to get the closest face to the supplied point. After that it's only a matter of projecting your point into that face, computing barycentric coordinates and interpolating the vertex colors.

hc_
  • 2,628
  • 1
  • 18
  • 19
0

I think you want to get this information for output mesh: VertexInfo = {origin face id, barycentric coordinate}. You can project vertex to original mesh to compute VertexInfo. However, it is not recommended to compute topology info from geometry info. Just thinking you have a box mesh that is nearly flat, I don't think you can get the right VertexInfo by reprojecting. The best way to get VertexInfo is to compute it in each concrete command by topology info, like you mentioned subdivide/decimate, etc.