Online3DViewer
Online3DViewer copied to clipboard
No colors are shown when loading ascii PLY file
(From #118)
Also, I tried to render a PLY file which has color information as " property uchar red property uchar green property uchar blue " But the rendering is not colored, it just shows a gray 3D model. Is this functionality yet to be developed or am I missing something.
Unfortunately vertex colors are not implemented for ascii ply files, only for binary ones. If you have the chance to save binary ply, it should work.
Yes, I just checked, it works for binary ply file. Thank you.
Three.js PLYLoader is capable of showing colored ascii PLY files and they actually have an example model titled "dolphins_colored.ply" in their "ascii" folder.
It shows colors in my viewer as well, see the attached picture.
The way I did it was to use the MeshPhongMaterial with "vertexColors: THREE.VertexColors" setting when creating a mesh.
Also to mention that the PLYLoader should be updated at approximately line 365, which shows as:
var vertex_indices = element.vertex_indices;
but should also include "vertex_index" to avoid console error related to non-existing "vertex_indices" property in the file:
var vertex_indices = element.vertex_indices || element.vertex_index;