Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed May 21, 2024
1 parent 30ef3b7 commit 1b8cad2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
11 changes: 7 additions & 4 deletions webgpu/lessons/ko/webgpu-vertex-buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
+
Expand Down
15 changes: 9 additions & 6 deletions webgpu/lessons/webgpu-vertex-buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
+
Expand Down
11 changes: 7 additions & 4 deletions webgpu/webgpu-vertex-buffers-index-buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1b8cad2

Please sign in to comment.