From 4d3f82e95514c6234161d1b48729e5e88925e8c0 Mon Sep 17 00:00:00 2001 From: yunusey Date: Sun, 17 Dec 2023 15:36:04 -0500 Subject: [PATCH] Fix UV mapping in ArrayMesh tutorial --- .../3d/procedural_geometry/arraymesh.rst | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/tutorials/3d/procedural_geometry/arraymesh.rst b/tutorials/3d/procedural_geometry/arraymesh.rst index a4693ca4ca7..87a27ed374f 100644 --- a/tutorials/3d/procedural_geometry/arraymesh.rst +++ b/tutorials/3d/procedural_geometry/arraymesh.rst @@ -265,7 +265,7 @@ that you find online. var y = cos(PI * v) # Loop over segments in ring. - for j in range(radial_segments): + for j in range(radial_segments + 1): var u = float(j) / radial_segments var x = sin(u * PI * 2.0) var z = cos(u * PI * 2.0) @@ -285,15 +285,6 @@ that you find online. indices.append(thisrow + j) indices.append(thisrow + j - 1) - if i > 0: - indices.append(prevrow + radial_segments - 1) - indices.append(prevrow) - indices.append(thisrow + radial_segments - 1) - - indices.append(prevrow) - indices.append(prevrow + radial_segments) - indices.append(thisrow + radial_segments - 1) - prevrow = thisrow thisrow = point @@ -324,7 +315,7 @@ that you find online. var y = Mathf.Cos(Mathf.Pi * v); // Loop over segments in ring. - for (var j = 0; j < _radialSegments; j++) + for (var j = 0; j < _radialSegments + 1; j++) { var u = ((float)j) / _radialSegments; var x = Mathf.Sin(u * Mathf.Pi * 2); @@ -348,17 +339,6 @@ that you find online. } } - if (i > 0) - { - indices.Add(prevRow + _radialSegments - 1); - indices.Add(prevRow); - indices.Add(thisRow + _radialSegments - 1); - - indices.Add(prevRow); - indices.Add(prevRow + _radialSegments); - indices.Add(thisRow + _radialSegments - 1); - } - prevRow = thisRow; thisRow = point; }