Commit 0372a0c8 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Add feature for import/export of colors in ply file (handles uint8 and

float32).
parent 04fbf590
......@@ -614,7 +614,7 @@ bool MeshTablesSurface<PFP>::importPly(const std::string& filename, std::vector<
unsigned int id = container.insertLine();
positions[id] = pos;
if (pid.hasColors())
if (pid.hasColorsUint8())
{
Geom::Vector<3, unsigned char> col ;
pid.vertexColorUint8(i, col) ;
......@@ -624,6 +624,16 @@ bool MeshTablesSurface<PFP>::importPly(const std::string& filename, std::vector<
colors[id] /= 255.0 ;
}
if (pid.hasColorsFloat32())
{
Geom::Vector<3, float> col ;
pid.vertexColorFloat32(i, col) ;
colors[id][0] = col[0] ;
colors[id][1] = col[1] ;
colors[id][2] = col[2] ;
}
verticesID.push_back(id);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment