Skip to content

Instantly share code, notes, and snippets.

@cornfact
Created July 20, 2017 16:57
Show Gist options
  • Save cornfact/595720c65b57939dcc3fa1fb2d45fe06 to your computer and use it in GitHub Desktop.
Save cornfact/595720c65b57939dcc3fa1fb2d45fe06 to your computer and use it in GitHub Desktop.
rotation
<!DOCTYPE html>
<html>
<head>
<!--<script src="../p5.min.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/p5.js"></script>
<script src="sketch.js"></script>
</head>
<body>
<!--<script src="sketch.js"></script>-->
</body>
</html>
//console.log("hello")
function setup() {
createCanvas(600, 500);
colorMode(HSL); // 0-360, 0-100, 0-100
background(200);
translate(width/2, height/2);
noStroke();
//for (var k = 0; k < 6; k++) {
//fill(k * 10, 100, 50)
for (var j = 0; j < 6; j++) {
rotate(radians(30))
fill(j * 20, 100, 50, 0.5)
beginShape();
for(var i = 0; i < 360; i += 1) {
var x = cos(radians(i)) * 200;
var y = sin(radians(i)) * 50;
vertex(x,y);
}
endShape(CLOSE);
}
//}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment