Last active
December 12, 2018 07:03
-
-
Save baobao/1ee09e0696017d21e9d646c7a6785e3e 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
// 底面Index | |
offsetIndex = vertices.Length - 1 - divideX; | |
// 1周したときのループIndex | |
var loopIndex = offsetIndex; | |
for (int i = divideX * 3 - 1; i >= 0; i--) | |
{ | |
if (i % 3 == 0) | |
{ | |
// 底面の先頂点 | |
indices[cnt++] = vertices.Length - 1; | |
offsetIndex++; | |
} | |
else if (i % 3 == 1) | |
{ | |
indices[cnt++] = offsetIndex; | |
} | |
else if (i % 3 == 2) | |
{ | |
var value = 1 + offsetIndex; | |
if (value >= vertices.Length - 1) | |
{ | |
value = loopIndex; | |
} | |
indices[cnt++] = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment