Skip to content

Updating the docs for triangle_strip #848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ let insideRadius = 100;
let outsideRadius = 150;

function setup() {
createCanvas(720, 400);
createCanvas(720, 400, WEBGL);
label = createP('');
label.style('color', 'white');
label.position(20, 10);
angleMode(DEGREES, 360, 255, 255);
colorMode(HSB);

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

let centerX = width / 2;
let centerY = height / 2;

translate(-centerX, -centerY);
// Set the number of points based on the mouse x position
let pointCount = map(mouseX, 0, width, 6, 60);

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

// Display the current pointCount
fill(255);
textSize(20);
text(`pointCount: ${pointCount}`, 30, 30);

label.html(`pointCount: ${pointCount}`);
// Draw the triangle strip by specifying points on
// the inside circle and outside circle alternately

Expand Down