Skip to content

Instantly share code, notes, and snippets.

@georgesb
Last active May 3, 2020 19:39
Show Gist options
  • Save georgesb/07adbca6a17766ae991f33b376307f9b to your computer and use it in GitHub Desktop.
Save georgesb/07adbca6a17766ae991f33b376307f9b to your computer and use it in GitHub Desktop.
Vertex
<script src="https://cdn.jsdelivr.net/npm/p5@0.10.2/lib/p5.js"></script>
<script src="https://cdn.jsdelivr.net/gh/georgesb/lib/drawGrid.js"></script>
<script src="script.js"></script>
function setup() {
createCanvas(650, 450);
drawGrid();
let c = color(255, 204, 0);
fill(c);
stroke('black');
}
function draw() {
beginShape();
vertex(50, 50);
vertex(50, 300);
vertex(250, 300);
vertex(350,250);
vertex(250, 200);
vertex(150, 200);
vertex(150, 50);
endShape(CLOSE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment