Skip to content

Commit

Permalink
fix index triangle diagram (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman authored Aug 21, 2024
1 parent 82e505d commit 637fea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions webgpu/lessons/webgpu-vertex-buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,12 @@ function createCircleVertices({
+ let ndx = 0;
+
+ // 1st tri 2nd tri 3rd tri 4th tri
+ // 0 1 2 2 1 3 4 5 6 6 5 7
+ // 0 1 2 2 1 3 2 3 4 4 3 5
+ //
+ // 0--2 2 4--6 6 .....
+ // 0--2 2 2--4 4 .....
+ // | / /| | / /|
+ // |/ / | |/ / |
+ // 1 1--3 5 5--7 .....
+ // 1 1--3 3 3--5 .....
+ for (let i = 0; i < numSubdivisions; ++i) {
+ const ndxOffset = i * 2;
+
Expand Down
6 changes: 3 additions & 3 deletions webgpu/webgpu-vertex-buffers-index-buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@
let ndx = 0;

// 1st tri 2nd tri 3rd tri 4th tri
// 0 1 2 2 1 3 4 5 6 6 5 7
// 0 1 2 2 1 3 2 3 4 4 3 5
//
// 0--2 2 4--6 6 .....
// 0--2 2 2--4 4 .....
// | / /| | / /|
// |/ / | |/ / |
// 1 1--3 5 5--7 .....
// 1 1--3 3 3--5 .....
for (let i = 0; i < numSubdivisions; ++i) {
const ndxOffset = i * 2;

Expand Down

0 comments on commit 637fea1

Please sign in to comment.