Problem with complex geometries

Software: Away3D 4.x

agventu, Newbie
Posted: 07 February 2015 06:38 AM   Total Posts: 8

Is there any way to generate a mesh if I just have vertices but no indices?

If not, how I could get the indexdata when I just have the vertices with no specific logic order?

Thanks

   

Avatar
Fabrice Closier, Administrator
Posted: 07 February 2015 12:43 PM   Total Posts: 1265   [ # 1 ]

yes, you mean something like a point cloud.

Away allows you to build any face you want, so technically speaking as long as you declare 3 vertices, 3 indices, 3 uvs. away will render the face(s).
To generate a surface of an object described as point cloud, you need to write your own logic. It can be, depending on what your cloud represent a simple to an extremely complex task.

a basic way, for instance if your cloud is having a fairly distributed noise and mainly on a single plane.
In a recursive loop, have a function that loops until each vertex is associated with an edge. Pick a vertice and invoke a function that finds the nearest 2 points. create a face(ind0, ind1, ind2). save 3 edges.
The edge object is simply edge(ind0,ind1), edge(ind1,ind2), edge(ind2,ind0).
Each time a face is generated, recursively you use the 3 resulting edges to find the nearest point that is in front of the edge line and the iteration goes on and on till all points are part of an edge.

Things gets way more complicated if the point cloud represents the volumetric info of an object or more. Or an object with inner data, then you will have to apply some Delaunay rules, probably have be preprocess data to sort the vertices using convex and convave hulls, isolate groups of points based on distance. Using space partitioning methods such as octrees, AABB tree, BSP’s will probably be part of the game too… if the data comes from a 3d laser scanner/depth cam, the device may export some color or depth info, that will be of a great help too.


so short answer: yes no prob to generate “a” mesh but to generate “the” mesh, it will depend on your data and rely on your programming skills and geometrical knowledge.

   

agventu, Newbie
Posted: 07 February 2015 06:58 PM   Total Posts: 8   [ # 2 ]

Thanks for your help.  It was very usefull in order to understand this awesome engine even more.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X