Skip to content

Commit 833e2c4

Browse files
authored
Merge pull request godotengine#8640 from yunusey/dev
Fix UV mapping in ArrayMesh tutorial
2 parents bdf5c7c + 4d3f82e commit 833e2c4

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

tutorials/3d/procedural_geometry/arraymesh.rst

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ that you find online.
265265
var y = cos(PI * v)
266266

267267
# Loop over segments in ring.
268-
for j in range(radial_segments):
268+
for j in range(radial_segments + 1):
269269
var u = float(j) / radial_segments
270270
var x = sin(u * PI * 2.0)
271271
var z = cos(u * PI * 2.0)
@@ -285,15 +285,6 @@ that you find online.
285285
indices.append(thisrow + j)
286286
indices.append(thisrow + j - 1)
287287

288-
if i > 0:
289-
indices.append(prevrow + radial_segments - 1)
290-
indices.append(prevrow)
291-
indices.append(thisrow + radial_segments - 1)
292-
293-
indices.append(prevrow)
294-
indices.append(prevrow + radial_segments)
295-
indices.append(thisrow + radial_segments - 1)
296-
297288
prevrow = thisrow
298289
thisrow = point
299290

@@ -324,7 +315,7 @@ that you find online.
324315
var y = Mathf.Cos(Mathf.Pi * v);
325316

326317
// Loop over segments in ring.
327-
for (var j = 0; j < _radialSegments; j++)
318+
for (var j = 0; j < _radialSegments + 1; j++)
328319
{
329320
var u = ((float)j) / _radialSegments;
330321
var x = Mathf.Sin(u * Mathf.Pi * 2);
@@ -348,17 +339,6 @@ that you find online.
348339
}
349340
}
350341

351-
if (i > 0)
352-
{
353-
indices.Add(prevRow + _radialSegments - 1);
354-
indices.Add(prevRow);
355-
indices.Add(thisRow + _radialSegments - 1);
356-
357-
indices.Add(prevRow);
358-
indices.Add(prevRow + _radialSegments);
359-
indices.Add(thisRow + _radialSegments - 1);
360-
}
361-
362342
prevRow = thisRow;
363343
thisRow = point;
364344
}

0 commit comments

Comments
 (0)