
Hi, I would like to report a bug in OBJReader of Open Mesh. I have written a program to read OBJ files and to render them using OpenGL. This program uses OpenMesh for loading files. When I load the attached file (CubeCol.obj), the program displays a gray coloured cube instead of a red cube (CubeCol.mtl defines the colour of the cube as red). All other object loaders and viewers (including Windows 3D viewer) displays the cube correctly with a red colour. I spent hours trying to identify the problem, and finally found out that if I remove the space character at the beginning of the last three lines in CubeCol.mtl, the cube gets displayed correctly. Apparently, OBJReader ignores lines in the mtl file where there is a space character in the first column. All other obj readers that I have used load the file correctly. Also, I have noticed that it is not sufficient to request face colours (mesh.request_face_colors()) before reading the mesh file to get the colour values from the mtl file. I also had to include IO::Options::FaceColor as the argument for the read_mesh() function to get face colours using mesh.color(faceHandle); I couldn't find any documentation giving the actual procedure for loading data from mtl files. Please let me know if I am using the correct method for loading obj files along with material properties. Thank you. Kind regards, Mukundan mukundan2013@gmail.com
participants (1)
-
Ramakrishnan Mukundan