The way I convert .obj files into .msh:
1)Convert .obj to .stl in blender or in meshlab
2)Use tetgen to tetrahedralize the surface model.Tetgen make a .mesh file
3)Convert .mesh to .msh in gmsh software
hope this helps,
In a simple way, you can load you *.obj mesh in blender, export in *.stl, then load the *.stl in the software gmesh and export a *.msh format.
If you really want to get it automatic in C++, you need to create the two classes (MeshObjLoader, MeshExporter) and specify each Data of the MeshExporter (position, edges, triangles,…[Read more]