Skip to content

Commit 28e75da

Browse files
authored
Merge pull request #848 from processing/perminder-17-patch-1
Updating the docs for triangle_strip
2 parents 8e635e9 + 92e1bce commit 28e75da

File tree

1 file changed

+6
-6
lines changed
  • src/content/examples/en/09_Angles_And_Motion/02_Triangle_Strip

1 file changed

+6
-6
lines changed

src/content/examples/en/09_Angles_And_Motion/02_Triangle_Strip/code.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ let insideRadius = 100;
22
let outsideRadius = 150;
33

44
function setup() {
5-
createCanvas(720, 400);
5+
createCanvas(720, 400, WEBGL);
6+
label = createP('');
7+
label.style('color', 'white');
8+
label.position(20, 10);
69
angleMode(DEGREES, 360, 255, 255);
710
colorMode(HSB);
811

@@ -16,18 +19,15 @@ function draw() {
1619

1720
let centerX = width / 2;
1821
let centerY = height / 2;
19-
22+
translate(-centerX, -centerY);
2023
// Set the number of points based on the mouse x position
2124
let pointCount = map(mouseX, 0, width, 6, 60);
2225

2326
// Round pointCount to the nearest integer
2427
pointCount = round(pointCount);
2528

2629
// Display the current pointCount
27-
fill(255);
28-
textSize(20);
29-
text(`pointCount: ${pointCount}`, 30, 30);
30-
30+
label.html(`pointCount: ${pointCount}`);
3131
// Draw the triangle strip by specifying points on
3232
// the inside circle and outside circle alternately
3333

0 commit comments

Comments
 (0)