'How can I generate a Point Cloud from a depth map in Unity
So I am quite new to Unity. I have a depthmap I generated with python. It consists of two arrays, one array with all the 3D points and one with the corresponding colors. I can match the points to the colors by index.
Now I want to show this depth map as a simple non-animated point cloud in unity. It is interesting to note, that the 3D-Points come from a 360° camera, so the Point cloud is supposed to be around the Unity Viewpoint.
Till now I attempted to use a mesh. I could just set the 3D points as the vertices and the colors as the colors of the mesh. Now I am having troubles defining the triangles for the mesh. When I am iterating over the points, I do not know what points in my array are the closest ones to the one I am currently looking at, because my points are not ordered. My Array for example would look like this:
[187 167 177]
[185 135 232]
[ 15 111 236]
[ 1 111 236]
[201 167 177]
Even if I would order my points, my problem is, that I would have to change the color array accordingly. And even then, since my points go around the viewport, I would somehow have to decide on which side of the camera my points are, to not draw triangles through the open space.
Now my questions are: Do I have to use triangles for meshes? Is there another way to display simple Point Clouds?
Thanks in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
