标签:
OpenMesh默认好像是不自动读取纹理坐标的,需要添加读取纹理坐标的option,但在程序中发现,需要两次打开才能正确读入纹理坐标,不知是否为一个bug。
1 OpenMesh::IO::Options opt_read = 0x0040; //选项控制读取纹理坐标 2 3 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 }
在OpenMesh的官方文档中,有更多关于IO的options,更详细的内容请看这里 http://www.openmesh.org/media/Documentations/OpenMesh-Doc-Latest/a00231.html#details
enum Flag { 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 }
标签:
原文地址:http://www.cnblogs.com/VVingerfly/p/4415953.html