- Home /
Algorithm for automatic mesh creation
Hi Guys,
i stumbled over a big problem in the project i'am working on:
i need to write an algorithm wich allows me to automatically connect vertices to Polygons (simply creating a mesh). Of course it would have to consider Convex and Concav Polygons (alignment of normals). So my question referrs to the possibility of writing such algorithm and if somebody knows if there are any tutorials or helps around.
The Input would be an Array filled with Vector 3 data (Vector 3 values and length/size of Array will be different each time).
I'am working in C# and would love to see you guy's advice and help.
Thanks in advance!
An array of vertices is just a collection of points. You can join them with edges in many ways, resulting in wildly different meshes. Does the array of vertices represent an actual 3D mesh in your case (for instance, a cube, or a piece of terrain, or a giraffe)?
iam simply showing a reallife object as 3d pointcloud and the array gives me the location of scratches so i can visualise them.but since i dont know were thes scatches might be the vertices need to be wired together by code.
Answer by Graham-Dunnett · May 06, 2012 at 08:12 PM
My guess is that you have not read this page:
http://unity3d.com/support/documentation/ScriptReference/Mesh.html
It tells you how you can create meshes procedurally with Unity. As Jarek says, how you interpret the Vector3 array as points, and how you wire them together into triangles is outside the scope of this forum.
yeah i know that page! just need to find a way to automatically wire the vertices given by the array together. im my case i don't have the array upfront, so i can't say 1#, 3#, 5# get's to be a polygon. i thought there's maybe some unity specific way to do that.
The point is, you can't tell what the connections between vertices should be from vertices alone. That's simply not enough information.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Unity Mesh Rendering Issue 0 Answers
Getting meshes to render properly, and coloring triangles of a mesh 0 Answers
How to snap a Prefab to the normal of an irregular mesh 1 Answer
Multiple Cars not working 1 Answer