Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 底面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