S
S
s2sk13372017-10-07 04:35:47
C++ / C#
s2sk1337, 2017-10-07 04:35:47

Dividing positions into triangles?

Hello.
Quite a difficult task.
Let's say I have an array of coordinates (3D space):
{4.00, 34.33, 34.33},
{23.00, 35.33, 53.33},
{43.00, 72.33, 32.33},
{52.00, 72.33, 42.33},
{62.00, 58.33, 37.33}
Well, in the picture it looks something like this (I drew 2D, but imagine that this is a top view)
8uZuGxs-wR4.jpg
Well, I need to write an algorithm that would divide these positions into triangles.
lIoS1tMWX_g.jpg
And I wrote down the construction of these triangles in a separate array. Well, that is, for example:
The first triangle is the first cell of coordinates, the second cell of coordinates, the third cell of coordinates
The second triangle is the first cell of coordinates, the third cell of coordinates, the fourth cell of coordinates
Etc.
Well, in C++ from cell 0, therefore:
{0. 1, 2},
{0, 2, 3},
etc.
And so that it is dynamic, if at least 1000 positions are given in the array of coordinates, so that all these positions are divided into triangles and written separately in the cell array of triangles coordinates.
I think I described it in detail.
But the main thing is that the triangles do not overlap each other, as for example like this:
On7nT2OTq2g.jpg
Thank you all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2017-10-07
@jcmvbkbc

The search keyword is " triangulation ".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question