Last active
September 3, 2018 21:13
-
-
Save RANUX/6aead80cf269a95601ef04e391ae6ae1 to your computer and use it in GitHub Desktop.
Draw squares grid with p5.js and Sketch
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
var canvasWidth = 1200; | |
var canvasHeight = 1024; | |
function setup() { | |
createCanvas(canvasWidth, canvasHeight); | |
} | |
function draw() { | |
stroke("#DCA6A6"); | |
strokeWeight(0.1); | |
beginShape(); | |
var width = canvasWidth/8; | |
var height = canvasHeight/8; | |
for(var i=0; i <= height; i++) { | |
vertex(0, i*8); | |
vertex(canvasWidth, i*8); | |
vertex(0, i*8); | |
} | |
for(var i=0; i <= width; i++) { | |
vertex(i*8, 0); | |
vertex(i*8, canvasHeight); | |
vertex(i*8, 0); | |
} | |
endShape(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment