Created
April 24, 2019 09:21
-
-
Save LottieVixen/3c14c876befed73446ea5e0cc183a1a1 to your computer and use it in GitHub Desktop.
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
| int divby = 10; | |
| int gridSize = 15; | |
| int cubeSize = 300; | |
| int cDist = 150; | |
| void setup() { | |
| size(1280,720, P3D); | |
| smooth(4); | |
| camera(0,0,cDist, | |
| 0,0,-cDist, | |
| 0,1,0); | |
| } | |
| void draw() { | |
| int vert = height / divby; | |
| int horz = width / divby; | |
| //translate(width/2, height/2, 0); | |
| //pushMatrix(); | |
| //scale(0.5); | |
| // Draws -z | |
| /* | |
| for (int i = boxsize; i < width; i = i + boxsize){ | |
| line(i, 0, dist, i, height,dist); | |
| } | |
| for (int i = boxsize; i < height; i = i + boxsize){ | |
| line(0, i, dist, width, i,dist); | |
| } | |
| // Draws -y | |
| for (int i = boxsize; i < width; i = i + boxsize){ | |
| line(i,0,dist,i,0,dist+300); | |
| } | |
| for (int i = dist; i < 150; i = i + boxsize){ | |
| line(0,0,i,width,0,i); | |
| } | |
| // Draws -x | |
| for (int i = boxsize; i < width; i = i + boxsize){ | |
| line(i,0,i,i,height,i); | |
| } | |
| for (int i = dist; i < 150; i = i + boxsize){ | |
| line(0,0,i,0,width,i); | |
| } | |
| */ | |
| for (int i = -cDist; i <= cDist; i += gridSize){ | |
| // +x | |
| line(cDist,-cDist,i, | |
| cDist, cDist,i); | |
| line(cDist,i,-cDist, | |
| cDist,i, cDist); | |
| // -x | |
| line(-cDist,-cDist,i, | |
| -cDist, cDist,i); | |
| line(-cDist,i,-cDist, | |
| -cDist,i, cDist); | |
| //Y | |
| //+ | |
| line(-cDist, cDist,i, | |
| cDist, cDist,i); | |
| line(i, cDist,-cDist, | |
| i, cDist, cDist); | |
| //- | |
| line(-cDist, -cDist,i, | |
| cDist, -cDist,i); | |
| line(i, -cDist,-cDist, | |
| i, -cDist, cDist); | |
| //Z | |
| //+ | |
| line(i,-cDist,cDist, | |
| i, cDist,cDist); | |
| line(-cDist,i,cDist, | |
| cDist,i,cDist); | |
| //- | |
| line(i,-cDist,-cDist, | |
| i, cDist,-cDist); | |
| line(-cDist,i,-cDist, | |
| cDist,i,-cDist); | |
| } | |
| //popMatrix(); | |
| /* | |
| beginShape(); | |
| vertex(-100,-100,-100); | |
| vertex(100,-100,-100); | |
| endShape(); | |
| */ | |
| if (mousePressed) { | |
| fill(0); | |
| } else { | |
| fill(255); | |
| } | |
| //ellipse(mouseX, mouseY, 80,80); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment