Last active
October 28, 2019 21:36
-
-
Save mimetaur/f12c49486df26a8bb3d9d48946c4ee4d to your computer and use it in GitHub Desktop.
Code 1 Week 5 Sketch #4 solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
createCanvas(400, 400); | |
background(220); | |
noStroke(); | |
fill(80); | |
} | |
function draw() { | |
drawSpiral(); | |
} | |
function drawSpiral() { | |
for (i = 0; i < 90; i++) { // loop | |
rectMode(CENTER); | |
angleMode(DEGREES); | |
translate(width / 2, height / 2); | |
applyMatrix(); | |
rotate(10 * i); | |
scale(0.5); | |
translate(200, 200); | |
rect(i, i, 10, 10); | |
resetMatrix(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment