kopia lustrzana https://github.com/villares/sketch-a-day
14 & 15
rodzic
646a85ea88
commit
78035f1a95
|
@ -0,0 +1,2 @@
|
|||
mode=Python
|
||||
mode.id=jycessing.mode.PythonMode
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 225 KiB |
|
@ -0,0 +1,11 @@
|
|||
|
||||
size(500, 500)
|
||||
margin = 12.5
|
||||
|
||||
for num in range(20):
|
||||
v = margin + num * 25
|
||||
for other_num in range(20):
|
||||
tam = random(10, 25)
|
||||
fill(random(128), random(256), random(128, 256))
|
||||
h = margin + other_num * 25
|
||||
ellipse(h, v, tam, tam)
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 67 KiB |
|
@ -0,0 +1,27 @@
|
|||
add_library('geomerative')
|
||||
|
||||
def setup():
|
||||
size(400, 400)
|
||||
strokeWeight(3)
|
||||
RG.init(this);
|
||||
|
||||
def draw():
|
||||
background(100)
|
||||
translate(width / 2, height / 2)
|
||||
|
||||
r0= rg_rect(mouseX, mouseY, 100, 100, QUARTER_PI)
|
||||
r1= rg_rect(mouseX, -mouseY, 100, 100, 0)
|
||||
r2= rg_rect(-mouseX, -mouseY, 100, 100, QUARTER_PI / 2)
|
||||
r3= rg_rect(-mouseX, mouseY, 100, 100)
|
||||
|
||||
resultado = RG.union( r0, r1 )
|
||||
resultado = RG.union( resultado, r2 )
|
||||
resultado = RG.union( resultado, r3 )
|
||||
RG.shape(resultado)
|
||||
|
||||
|
||||
def rg_rect(x, y, w, h, rot=0):
|
||||
r = RShape.createRectangle(0, 0, w, h)
|
||||
r.translate(x - w/2, y - h/2)
|
||||
r.rotate(rot, RPoint(x, y))
|
||||
return r
|
Ładowanie…
Reference in New Issue