question

DiogoMiguelRebeloBarroso-5778 avatar image
0 Votes"
DiogoMiguelRebeloBarroso-5778 asked TimonYang-MSFT edited

Triangles and Vectors question

Hello, currently i'm using unity to develop a game in c#...
Basically i have 2 triangles with random positions in a 3d space...
These triangles have and index and array of their vertices positions, so...

public class Triangle
{
public int index;
public Vector3[] _transform = new Vector3[3];
}
when i create the 2 triangle objects i would like to check if they are neighbours, meaning if they have 2 vertices in commun, then i would like to save their indexes and the 2 coincident points so...

public class TriPairs
{
public Vector2Int pair;
public Vector3[] points = new Vector3[2];
}

i tried making a nested for loop for comparison but it just increases in complexity when trying to compare and extract the points, any ideas?
Thanks in advance

not-supported
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DiogoMiguelRebeloBarroso-5778
This problem is a Unity specific problem, and unfortunately, Unity is not in the support list of Microsoft Q&A. I suggest you go to the forum provided by Unity to ask your question.

The current list of products supported by Microsoft Q&A: Microsoft Q&A supported products

1 Vote 1 ·

0 Answers