05-08-2019, 10:11 AM
(This post was last modified: 05-08-2019, 10:15 AM by josemendez.)
(02-08-2019, 11:06 AM)ctalDai Wrote: Hello,
I am tearing a cloth manually via script. What I want is just holes/cuts to appear in the cloth. Right now, When I tear the cloth tiny triangles are formed which makes it looks bad.
How do I make it so that when the cloth is torn, no new triangles are formed and just cuts/holes appear?
As in the picture, there are many small triangles after tear. I need just the hole but not the extra triangles.
Thank you. Please Help.
Hi there,
Assuming you're manually calling Tear() via a script, as it seems: to achieve this, you have to be mindful about the mesh topology when selecting which edges to tear, being careful not to tear these that are not part of the perimeter of the shape you want to cut out.
The ObiMeshTopology class implements a half-edge structure, that contains many adjacency queries to help you out traversing the structure. For instance, you can get all edges around a vertex by using:
Code:
GetNeighbourEdgesEnumerator(Oni.Vertex vertex);
Some references for more info on the half-edge structure:
https://en.wikipedia.org/wiki/Doubly_con..._edge_list
https://www.flipcode.com/archives/The_Ha...ture.shtml
http://www.enseignement.polytechnique.fr...ctures.pdf
http://kaba.hilvi.org/homepage/blog/half...lfedge.htm