kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
05027d24f9
commit
4380349a73
11
README.md
11
README.md
|
@ -6,6 +6,17 @@ Hi! I'm [Alexandre Villares](https://abav.lugaralgum.com), let's see if I can ma
|
|||
|
||||
If you enjoy this, be a [patreon](https://patreon.com/arteprog) or make a donation [here](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HCGAKACDMVNV2)
|
||||
|
||||
---
|
||||
|
||||

|
||||
264: [code](https://github.com/villares/sketch-a-day/tree/master/s264) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
---
|
||||
|
||||

|
||||
263: [code](https://github.com/villares/sketch-a-day/tree/master/s263) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 210 KiB |
|
@ -6,23 +6,40 @@ def setup():
|
|||
size(600, 600)
|
||||
noFill()
|
||||
rectMode(CENTER)
|
||||
strokeWeight(3)
|
||||
|
||||
|
||||
def draw():
|
||||
noLoop()
|
||||
background(255)
|
||||
translate(width/2, height/2)
|
||||
grid(20, squares, 20, 10)
|
||||
|
||||
def squares(i, j, spacing, w):
|
||||
with pushMatrix():
|
||||
translate(-order * spacing / 2, -order * spacing / 2)
|
||||
rect(spacing/2 + i * spacing, spacing/2 + j * spacing, w, w)
|
||||
for _ in range(100):
|
||||
order = int(random(5, 10))
|
||||
spacing = 20
|
||||
radius = random(0, 5)
|
||||
x = random(order * spacing/2, width - order * spacing/2)
|
||||
y = random(order * spacing/2, height - order * spacing/2)
|
||||
grid(x, y, order, spacing,
|
||||
rect, 10, 10, *[radius]*4)
|
||||
|
||||
def grid(order, function, *args):
|
||||
for i in range(order):
|
||||
def grid(x, y, order, spacing, function, *args):
|
||||
with pushMatrix():
|
||||
translate(x - order * spacing / 2, y- order * spacing / 2)
|
||||
for i in range(order):
|
||||
for j in range(order):
|
||||
function(i, j, , order, *args)
|
||||
function(spacing/2 + i * spacing, spacing/2 + j * spacing,
|
||||
*args)
|
||||
|
||||
def keyPressed():
|
||||
if key == " ": loop()
|
||||
|
||||
|
||||
# def squares(order, i, j, x, y, spacing, w):
|
||||
# with pushMatrix():
|
||||
# translate(x - order * spacing / 2, y- order * spacing / 2)
|
||||
# rect(spacing/2 + i * spacing, spacing/2 + j * spacing, w, w)
|
||||
|
||||
# def grid(x, y, order, spacing, function, *args):
|
||||
# for i in range(order):
|
||||
# for j in range(order):
|
||||
# function(order, i, j, *args)
|
||||
|
||||
# print text to add to the project's README.md
|
||||
def settings():
|
||||
|
|
Ładowanie…
Reference in New Issue