将三角形划分为较小的三角形3D

时间:2017-11-30 15:44:43

标签: c++ algorithm graphics

是否有将三角形划分为较小三角形的算法?我有每个点和索引列表的坐标,我需要将每个三角形分成例如3个较小的三角形。但我不知道如何使用指数。

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
};

0 个答案:

没有答案
相关问题