diff --git a/webgpu/lessons/ko/webgpu-vertex-buffers.md b/webgpu/lessons/ko/webgpu-vertex-buffers.md index 53edae39..fd835811 100644 --- a/webgpu/lessons/ko/webgpu-vertex-buffers.md +++ b/webgpu/lessons/ko/webgpu-vertex-buffers.md @@ -895,10 +895,13 @@ function createCircleVertices({ + const indexData = new Uint32Array(numSubdivisions * 6); + let ndx = 0; + -+ // 0---2---4---... -+ // | //| //| -+ // |// |// |// -+ // 1---3-- 5---... ++ // 1st tri 2nd tri 3rd tri 4th tri ++ // 0 1 2 2 1 3 4 5 6 6 5 7 ++ // ++ // 0--2 2 4--6 6 ..... ++ // | / /| | / /| ++ // |/ / | |/ / | ++ // 1 1--3 5 5--7 ..... + for (let i = 0; i < numSubdivisions; ++i) { + const ndxOffset = i * 2; + diff --git a/webgpu/lessons/webgpu-vertex-buffers.md b/webgpu/lessons/webgpu-vertex-buffers.md index 2772c7a1..3bc427f2 100644 --- a/webgpu/lessons/webgpu-vertex-buffers.md +++ b/webgpu/lessons/webgpu-vertex-buffers.md @@ -533,8 +533,8 @@ function createCircleVertices({ + addVertex(c1 * radius, s1 * radius, ...outerColor); + addVertex(c2 * radius, s2 * radius, ...outerColor); + addVertex(c1 * innerRadius, s1 * innerRadius, ...innerColor); -- -- // second triangle + + // second triangle - addVertex(c1 * innerRadius, s1 * innerRadius); - addVertex(c2 * radius, s2 * radius); - addVertex(c2 * innerRadius, s2 * innerRadius); @@ -927,10 +927,13 @@ function createCircleVertices({ + const indexData = new Uint32Array(numSubdivisions * 6); + let ndx = 0; + -+ // 0---2---4---... -+ // | //| //| -+ // |// |// |// -+ // 1---3-- 5---... ++ // 1st tri 2nd tri 3rd tri 4th tri ++ // 0 1 2 2 1 3 4 5 6 6 5 7 ++ // ++ // 0--2 2 4--6 6 ..... ++ // | / /| | / /| ++ // |/ / | |/ / | ++ // 1 1--3 5 5--7 ..... + for (let i = 0; i < numSubdivisions; ++i) { + const ndxOffset = i * 2; + diff --git a/webgpu/webgpu-vertex-buffers-index-buffer.html b/webgpu/webgpu-vertex-buffers-index-buffer.html index dcd7260f..baf2384f 100644 --- a/webgpu/webgpu-vertex-buffers-index-buffer.html +++ b/webgpu/webgpu-vertex-buffers-index-buffer.html @@ -82,10 +82,13 @@ const indexData = new Uint32Array(numSubdivisions * 6); let ndx = 0; - // 0---2---4---... - // | //| //| - // |// |// |// - // 1---3-- 5---... + // 1st tri 2nd tri 3rd tri 4th tri + // 0 1 2 2 1 3 4 5 6 6 5 7 + // + // 0--2 2 4--6 6 ..... + // | / /| | / /| + // |/ / | |/ / | + // 1 1--3 5 5--7 ..... for (let i = 0; i < numSubdivisions; ++i) { const ndxOffset = i * 2;