alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

How can I get vertices color of `ply` files #107

Closed greatwallet closed 3 years ago

greatwallet commented 3 years ago

I tried with readPLY but it only returns vertices' positions and normals.

alecjacobson commented 3 years ago

my readPLY is just a wrapper for Gabriel Peyre's external/read_ply.m. You might hunt around in that function to see if it's already reading colors and normals.

rFalque commented 3 years ago

A dirty and lazy (but quick) workaround is to use the built-in pcread function for pointclouds in matlab (e.g., ptCloud = pcread('teapot.ply');).

Then the colors are available in ptCloud.Color

greatwallet commented 3 years ago

A dirty and lazy (but quick) workaround is to use the built-in pcread function for pointclouds in matlab (e.g., ptCloud = pcread('teapot.ply');).

Then the colors are available in ptCloud.Color

Thanks! Actually that was exactly what I did, though I think it might be great if readPLY could provide both functions.