Is it possible to generate a script in Unity that will construct a meshed object from imported point cloud data?
Thank you in advance!
Is it possible to generate a script in Unity that will construct a meshed object from imported point cloud data?
Thank you in advance!
Yes! If you want to create a mesh out of the point cloud just read the point cloud data and store the coordinates of each point in an array. That way you can create the mesh runtime by passing the vertices to unity: Unity - Scripting API: Mesh. You can use MeshTopology to change the rendering to point, and then create a geometry shader to better visualize each point (by placing a triangle in each vertex for example, ,Implementing a Geometry shader for a pointcloud - Questions & Answers - Unity Discussions this might help).
But if you want to reconstruct the content in the point cloud by making actual planes and connected triangles, you need to search some techniques like marching cubes if I’m not mistaken, this might help Coding Adventure: Marching Cubes - YouTube.
Thank you for your reply - it helped massively!
I am now coming up against another problem: trying to store and imported data from two separate csv files (1 that holds the x, y, z, coordinates of a vertex, and the other that holds the information to construct triangles between each vertex) that will allow me to construct a 10 vertex tetrahedron. How would I go about doing this?
I am trying to import from two files that are of the following structure:
my current way of storing the two sets of data are:
// Read in Node and Element data
NodeList = CSVReader.Read(inputfile_Nodes);
ElementList = CSVReader.Read(inputfile_Elements);
// List for holding data from CSV reader
private List<Dictionary<string, object>> NodeList;
private List<Dictionary<string, object>> ElementList;
I have tried to combine the two dictionaries by trying to search for the corresponding ‘Key’ in the Node List that matches the corresponding ‘Value’ in the Element List.
Any help would be greatly appreciated.