Openmesh default seems to not automatically read texture coordinates, you need to add option to read the texture coordinates, but found in the program, need two times to read the texture coordinates correctly, do not know whether it is a bug.
1 openmesh::io::options opt_read = 0x0040< /span>; // option controls read texture coordinates 2 if ( ! Openmesh::io::read_mesh (*ptr_mesh_, Byfilename.data (), opt_read)) 4 { 5 std::cerr<< " cannot Open mesh to file ' 1.obj ' " << Std::endl; 6 return 7 }
In Openmesh's official documentation, there are more options for IO, see here for more details http://www.openmesh.org/media/Documentations/OpenMesh-Doc-Latest/ A00231.html#details
enumFlag {Default=0x0000, Binary =0x0001, MSB =0x0002, LSB =0x0004, Swap=0x0006, Vertexnormal =0x0010, Vertexcolor =0x0020, Vertextexcoord =0x0040, Edgecolor=0x0080, Facenormal =0x0100, Facecolor =0x0200, Facetexcoord =0x0400, Coloralpha=0x0800, colorfloat =0x1000, Custom =0x2000 }
Openmesh reading Texture coordinates