is there an algorithm for dividing the triangle into smaller triangles? I have the coordinates of each point and indices list and I need to divide each triangle into for example 3 smaller triangles. But I do not know how to work with indices.
struct p{
float color[3];
float position[3];};
const p Vertices[] = {
{ { 0.0, 0.0, 1.0 }, { -10.0, -10.0, -10.0 } },
{ { 0.0, 0.0, 1.0 }, { -10.0, -10.0, 10.0 } },
{ { 0.0, 0.0, 1.0 }, { 10.0, -10.0, 10.0 } },
{ { 0.0, 0.0, 1.0 }, { 10.0, -10.0, -10.0 } }
};
const unsigned char indices[] = {
0, 1, 2,
0, 2, 3
};