Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active December 5, 2018 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baobao/f00df08d2b400c93d579fc13b0fe3c5d to your computer and use it in GitHub Desktop.
Save baobao/f00df08d2b400c93d579fc13b0fe3c5d to your computer and use it in GitHub Desktop.
// 開始Index
startIndex = indices[1];
for (int i = 0; i < sideIndexLen; i++)
{
if (i % 6 == 0 || i % 6 == 3)
{
indices[cnt++] = startIndex;
}
else if (i % 6 == 1)
{
indices[cnt++] = startIndex + divideX;
}
else if (i % 6 == 2 || i % 6 == 4)
{
indices[cnt++] = startIndex + divideX + 1;
}
else if (i % 6 == 5)
{
indices[cnt++] = startIndex + 1;
// 四角形を作り終えたら開始Indexをインクリメントする
startIndex++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment