From 1e622a70931618d90f29bb1e3ba242d644eeb676 Mon Sep 17 00:00:00 2001 From: Lev Date: Thu, 15 Jul 2021 23:52:15 -0500 Subject: [PATCH] Update completed rose with begin/endShape --- .../Topic 8/8.1.8 Polar Roses/sketch.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CM2030 Graphics Programming/Topic 8/8.1.8 Polar Roses/sketch.js b/CM2030 Graphics Programming/Topic 8/8.1.8 Polar Roses/sketch.js index 2018b08..ab1cd7e 100644 --- a/CM2030 Graphics Programming/Topic 8/8.1.8 Polar Roses/sketch.js +++ b/CM2030 Graphics Programming/Topic 8/8.1.8 Polar Roses/sketch.js @@ -9,13 +9,17 @@ function draw() background(0); translate(width/2, height/2); + stroke(255); + noStroke(); + + beginShape(); for (let angle=0; angle < TWO_PI; angle += 0.02) { - let r = 200 * cos( 10 * angle); + let r = 200 * cos(7 * angle); let x = r * cos(angle); let y = r * sin(angle); - stroke(255); - strokeWeight(4); - point(x, y); + + vertex(x, y); } + endShape(CLOSE); } \ No newline at end of file