Search Unity

How to traverse mesh vertices based on their location?

Discussion in 'Scripting' started by alikanat, Nov 12, 2018.

  1. alikanat

    alikanat

    Joined:
    Aug 8, 2018
    Posts:
    7
    I am using Point Cloud Free Viewer to visualize Point Clouds in Unity. It has a script and it parses .off file and creates meshes without triangulating. However, the code creates multiple meshes since its index format is 16bit. I modified the code for utilizing 32 bit format and i have a mesh named Manu0 with 2 million points. I want to color any object based on point density. For that i have to be able divide this mesh into grids or volumes so that i can calculate how many point that grid contains. I have created a multithreaded program to do this but even this is somehow slow and traversing the volume like sliding window is somehow troublesome. I would be happy if someone can give me any ideas or any leads how to do this. I have tried kdtrees as well which was slow as well. Any help is appreciated. Thanks Manu.png
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    sounds like a very interesting project you do there :)
    I think it is obvious that the performance issue is because of the immense amount of points. So probably you have to reduce the polygon points somehow.
    "Polygon Reduction" as used for "Level of Detail" may help you to increase performance :)
     
  3. alikanat

    alikanat

    Joined:
    Aug 8, 2018
    Posts:
    7
    I actually have no polygons just vertices since my object is a point cloud. But probably i will have to down sample if i cant find any fast solution.
     
  4. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    I understand that you have points from a point cloud.
    Voxels are usually converted to polygons to be able to render them with hardware acceleration. Point clouds are similar to voxels so I thought you would follow the same strategy.
    How do you render the points then?
    I guess if you would use CUDA for rendering (not sure how to do that with unity) you could increase the performance a lot. The downside: CUDA is NVidia only, so it would only run on computers with a NVidia graphics chip (which supports CUDA, but I think nowadays all NVidia chips have it).
     
  5. alikanat

    alikanat

    Joined:
    Aug 8, 2018
    Posts:
    7

    Attached Files: