Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// divideX*3・・・分割数分の三角形を作成するために、三角形に必要な頂点数3を乗算する
for (int i = 0; i < divideX * 3; i++)
{
if (i % 3 == 0)
{
// 天面の出っ張り
indices[cnt++] = 0;
}
else if (i % 3 == 1)
{
indices[cnt++] = 1 + offsetIndex;
}
else if (i % 3 == 2)
{
var index = 2 + offsetIndex++;
// ループさせるためにindices[1]を使う
index = index > divideX ? indices[1] : index;
indices[cnt++] = index;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment