Skip to content

Instantly share code, notes, and snippets.

@davidvandenbor
Last active April 28, 2020 01:48
Show Gist options
  • Save davidvandenbor/31ea0b06ad81401fa371230b0dfbff3d to your computer and use it in GitHub Desktop.
Save davidvandenbor/31ea0b06ad81401fa371230b0dfbff3d to your computer and use it in GitHub Desktop.

Revisions

  1. davidvandenbor revised this gist Apr 28, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Drawing-tiny-houses-with-P5.js.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Drawing tiny houses with P5.js
    ## Drawing tiny houses with P5.js and javascript nested loops

    Using P5.js in combination with nested javascript loops to draw a grid of tiny houses. **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/31ea0b06ad81401fa371230b0dfbff3d)

  2. davidvandenbor revised this gist Apr 28, 2020. No changes.
  3. davidvandenbor revised this gist Apr 28, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,11 @@
    <html lang="en">

    <head>
    <meta name="description" content="Huisjes tekenen met P5.js">
    <meta name="description" content="Huisjes tekenen met P5.js">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Huisjes maken met p5.js</title>
    <title>Drawing houses with p5.js</title>

    <!-- Links to P5.js libraries -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.js" crossorigin=""></script>
  4. davidvandenbor revised this gist Apr 28, 2020. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion Drawing-tiny-houses-with-P5.js.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,5 @@

    Using P5.js in combination with nested javascript loops to draw a grid of tiny houses. **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/31ea0b06ad81401fa371230b0dfbff3d)


    Edit / Play around with it for yourself in **Plunker**! > See link below:
    https://plnkr.co/edit/gist:31ea0b06ad81401fa371230b0dfbff3d
  5. davidvandenbor revised this gist Apr 28, 2020. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions Drawing-tiny-houses-with-P5.js.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,7 @@
    ## Drawing tiny houses with P5.js

    Using P5.js in combination with nested javascript loops to draw a grid of tiny houses.
    Using P5.js in combination with nested javascript loops to draw a grid of tiny houses. **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/31ea0b06ad81401fa371230b0dfbff3d)

    **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/31ea0b06ad81401fa371230b0dfbff3d)

    ### Edit:
    Edit / Play around with it for yourself in **Plunker**! > See link below:
    https://plnkr.co/edit/gist:31ea0b06ad81401fa371230b0dfbff3d
  6. davidvandenbor revised this gist Apr 28, 2020. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions Drawing-tiny-houses-with-P5.js.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    ## Drawing a grid with tiny houses with P5.js
    ## Drawing tiny houses with P5.js

    **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/b98556c9eedd735e79a4af043835f909)
    Using P5.js in combination with nested javascript loops to draw a grid of tiny houses.

    **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/31ea0b06ad81401fa371230b0dfbff3d)

    ### Edit:
    Edit / Play around with it for yourself in **Plunker**! > See link below:
    https://plnkr.co/edit/gist:b98556c9eedd735e79a4af043835f909
    https://plnkr.co/edit/gist:31ea0b06ad81401fa371230b0dfbff3d
  7. davidvandenbor revised this gist Apr 28, 2020. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions Drawing-tiny-houses-with-P5.js.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,7 @@
    ## Huisjes tekenen met P5.js
    source bestanden op JSBin https://jsbin.com/dogiper/edit?html,js,output
    ## Drawing a grid with tiny houses with P5.js

    **Preview:** [at bl.ocks.org](https://bl.ocks.org/David-van-den-Bor/b98556c9eedd735e79a4af043835f909)

    ### Edit:
    Edit / Play around with it for yourself in **Plunker**! > See link below:
    https://plnkr.co/edit/gist:b98556c9eedd735e79a4af043835f909
  8. davidvandenbor renamed this gist Apr 28, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. davidvandenbor revised this gist Apr 27, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Readme.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    ## Huisjes tekenen met P5.js
    source https://jsbin.com/dogiper/edit?html,js,output
    source bestanden op JSBin https://jsbin.com/dogiper/edit?html,js,output
  10. davidvandenbor revised this gist Apr 27, 2020. No changes.
  11. davidvandenbor revised this gist Apr 27, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    ## Huisjes tekenen met P5.js
    source https://jsbin.com/dogiper/edit?html,js,output
  12. davidvandenbor revised this gist Apr 27, 2020. No changes.
  13. davidvandenbor revised this gist Apr 27, 2020. No changes.
  14. davidvandenbor revised this gist Apr 27, 2020. 2 changed files with 2 additions and 51 deletions.
    53 changes: 2 additions & 51 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -14,56 +14,7 @@
    </head>

    <body>
    <script id="jsbin-javascript">
    // The p5.js push() function allows you to create a new state and pop() function restores the state to the previous conditions. This allows you to have completely different settings applied to individual objects without worrying those settings to affect the shapes that come after as long as you do everything in between a push() and a pop() call. Here is how it works:

    function setup() {
    createCanvas(900, 900);
    }

    function draw() {
    background(240);
    for (var x = 5; x < 600; x = x + 50) {
    for (var y = 5; y < 600; y = y + 50) {
    push();
    translate(x, y);
    drawHouse();
    pop();
    }
    }
    }

    function drawHouse() {
    triangle(15, 0, 0, 15, 30, 15);
    rect(0, 15, 30, 25);
    rect(12, 30, 10, 10);
    }
    </script>



    <script id="jsbin-source-javascript" type="text/javascript">// The p5.js push() function allows you to create a new state and pop() function restores the state to the previous conditions. This allows you to have completely different settings applied to individual objects without worrying those settings to affect the shapes that come after as long as you do everything in between a push() and a pop() call. Here is how it works:

    function setup() {
    createCanvas(900, 900);
    }

    function draw() {
    background(240);
    for (var x = 5; x < 600; x = x + 50) {
    for (var y = 5; y < 600; y = y + 50) {
    push();
    translate(x, y);
    drawHouse();
    pop();
    }
    }
    }

    function drawHouse() {
    triangle(15, 0, 0, 15, 30, 15);
    rect(0, 15, 30, 25);
    rect(12, 30, 10, 10);
    }</script></body>
    <script src="index.js"></script>
    </body>

    </html>
    File renamed without changes.
  15. davidvandenbor created this gist Apr 27, 2020.
    69 changes: 69 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,69 @@
    <!DOCTYPE html>
    <html lang="en">

    <head>
    <meta name="description" content="Huisjes tekenen met P5.js">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Huisjes maken met p5.js</title>

    <!-- Links to P5.js libraries -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.js" crossorigin=""></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.dom.min.js" crossorigin=""></script>
    </head>

    <body>
    <script id="jsbin-javascript">
    // The p5.js push() function allows you to create a new state and pop() function restores the state to the previous conditions. This allows you to have completely different settings applied to individual objects without worrying those settings to affect the shapes that come after as long as you do everything in between a push() and a pop() call. Here is how it works:

    function setup() {
    createCanvas(900, 900);
    }

    function draw() {
    background(240);
    for (var x = 5; x < 600; x = x + 50) {
    for (var y = 5; y < 600; y = y + 50) {
    push();
    translate(x, y);
    drawHouse();
    pop();
    }
    }
    }

    function drawHouse() {
    triangle(15, 0, 0, 15, 30, 15);
    rect(0, 15, 30, 25);
    rect(12, 30, 10, 10);
    }
    </script>



    <script id="jsbin-source-javascript" type="text/javascript">// The p5.js push() function allows you to create a new state and pop() function restores the state to the previous conditions. This allows you to have completely different settings applied to individual objects without worrying those settings to affect the shapes that come after as long as you do everything in between a push() and a pop() call. Here is how it works:

    function setup() {
    createCanvas(900, 900);
    }

    function draw() {
    background(240);
    for (var x = 5; x < 600; x = x + 50) {
    for (var y = 5; y < 600; y = y + 50) {
    push();
    translate(x, y);
    drawHouse();
    pop();
    }
    }
    }

    function drawHouse() {
    triangle(15, 0, 0, 15, 30, 15);
    rect(0, 15, 30, 25);
    rect(12, 30, 10, 10);
    }</script></body>

    </html>
    23 changes: 23 additions & 0 deletions jsbin.dogiper.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    // The p5.js push() function allows you to create a new state and pop() function restores the state to the previous conditions. This allows you to have completely different settings applied to individual objects without worrying those settings to affect the shapes that come after as long as you do everything in between a push() and a pop() call. Here is how it works:

    function setup() {
    createCanvas(900, 900);
    }

    function draw() {
    background(240);
    for (var x = 5; x < 600; x = x + 50) {
    for (var y = 5; y < 600; y = y + 50) {
    push();
    translate(x, y);
    drawHouse();
    pop();
    }
    }
    }

    function drawHouse() {
    triangle(15, 0, 0, 15, 30, 15);
    rect(0, 15, 30, 25);
    rect(12, 30, 10, 10);
    }