Last active
December 5, 2018 00:53
-
-
Save baobao/6c159dd8b9388b1cb37ef49310e2d007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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