Skip to content
Snippets Groups Projects
Commit f55169e8 authored by John Schihada's avatar John Schihada
Browse files

Fixed 360° Circular-Segment

parent 38f6c0cb
No related branches found
No related tags found
No related merge requests found
......@@ -58,14 +58,17 @@ private void CreateSegment(float angle, float radius)
float firstPointZ = radius * Mathf.Sin(negAngle * Mathf.Deg2Rad);
verticeList.Add(new Vector3(firstPointX, 0, firstPointZ));
verticeList.Add(new Vector3(firstPointX, height, firstPointZ));
//Adding triangles for left side
triangleList.Add(center0Index);
triangleList.Add(center1Index);
triangleList.Add(i + 1);
triangleList.Add(center0Index);
triangleList.Add(i + 1);
triangleList.Add(i);
if (absoluteAngle != 360)
{
triangleList.Add(center0Index);
triangleList.Add(center1Index);
triangleList.Add(i + 1);
triangleList.Add(center0Index);
triangleList.Add(i + 1);
triangleList.Add(i);
}
i += 2;
}
......@@ -88,7 +91,7 @@ private void CreateSegment(float angle, float radius)
triangleList.Add(i + 1);
triangleList.Add(i);
if (nextAngle == posAngle)
if (nextAngle == posAngle && absoluteAngle != 360)
{
//Adding triangles for right side
triangleList.Add(center0Index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment