Bug in PLY exporter with vertex colors?
Hi! I was trying to export a TriMesh to the PLY file format with vertex colors. The mesh looks as expected in OpenFlipper. But the exported mesh was all black in MeshLab. When looking at the PLY file, the components of the colors were all either 0 or 1. I believe there is a bug in the PLY exporter. TriTraits::Color is defined as Vec4f. FilePLYT.cc exports this as ofs << " " << OpenMesh::color_cast<OpenMesh::Vec3i>(c); That means, that in fact OpenMesh::color_coder<Vec3i, Vec4f> is used for the conversion. Since there is no such specialization of color_coder, the default template will be used, which just converts to int. Thus, the resulting colors will all be not correct. Shouldn't it be this? ofs << " " << OpenMesh::color_cast<OpenMesh::Vec3uc>(c); Bye, Bengt
On 22.08.2012 02:22, Bengt Rosenberger wrote:
Hi!
I was trying to export a TriMesh to the PLY file format with vertex colors. The mesh looks as expected in OpenFlipper. But the exported mesh was all black in MeshLab. When looking at the PLY file, the components of the colors were all either 0 or 1.
I believe there is a bug in the PLY exporter. TriTraits::Color is defined as Vec4f. FilePLYT.cc exports this as ofs << " " << OpenMesh::color_cast<OpenMesh::Vec3i>(c);
That means, that in fact OpenMesh::color_coder<Vec3i, Vec4f> is used for the conversion. Since there is no such specialization of color_coder, the default template will be used, which just converts to int. Thus, the resulting colors will all be not correct.
Shouldn't it be this? ofs << " " << OpenMesh::color_cast<OpenMesh::Vec3uc>(c);
Bye, Bengt _______________________________________________ Openflipper mailing list Openflipper@lists.rwth-aachen.de http://mailman.rwth-aachen.de/mailman/listinfo/openflipper
Hi, thanks for the report. Is fixed in the svn and will enter the next release (Daily builds already include that fix). Best, Jan -- Dipl.Inform. Jan Möbius Department of Computer Science VIII Aachen University of Technology (RWTH) Ahornstrasse 55, 52074 Aachen, Germany Phone ++49 (0)241 80-21817 Fax ++49 (0)241 80-22899 mailto:moebius@cs.rwth-aachen.de http://www.rwth-graphics.de
participants (2)
-
Bengt Rosenberger
-
Jan Möbius