Alexandre B A Villares 2018-08-15 21:34:19 -03:00
rodzic 7bfd6fc040
commit ed3deb7d77
3 zmienionych plików z 85 dodań i 0 usunięć

Wyświetl plik

@ -6,6 +6,27 @@ 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)
---
![s229](s229/s229.png)
229: [code](https://github.com/villares/sketch-a-day/tree/master/s229) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![s228](s228/s228.png)
228: [code](https://github.com/villares/sketch-a-day/tree/master/s228) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![s227](s227/s227.gif)
227: [code](https://github.com/villares/sketch-a-day/tree/master/s227) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![s226](s226/s226.gif)

BIN
s229/s229.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 58 KiB

64
s229/s229.pyde 100644
Wyświetl plik

@ -0,0 +1,64 @@
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
# s229 20180815
add_library('peasycam')
def setup():
size(500, 500, P3D)
# optional PeasyCam setup to allow orbiting with a mouse drag
cam = PeasyCam(this, 100)
cam.setMinimumDistance(500)
cam.setMaximumDistance(1000)
def draw():
background(100)
my_box(200)
def my_box(side):
front = ((-1, +1, -1),
(-1, +1, +1),
(+1, +1, +1),
(+1, +1, -1),
)
back = ((-1, -1, -1),
(-1, -1, +1),
(+1, -1, +1),
(+1, -1, -1),
)
left = ((-1, -1, -1),
(-1, -1, +1),
(-1, +1, +1),
(-1, +1, -1),
)
right = ((+1, -1, -1),
(+1, -1, +1),
(+1, +1, +1),
(+1, +1, -1),
)
down = ((-1, -1, -1),
(+1, -1, -1),
(+1, +1, -1),
(-1, +1, -1),
)
top = ((-1, -1, -1),
(+1, -1, -1),
(+1, +1, -1),
(-1, +1, -1),
)
faces = ((top, color(255, 0, 0, 100)),
(down, color(0, 255, 0, 100)),
(right, color(0, 0, 255, 100)),
(left, color(255, 255, 0, 100)),
(back, color(255, 0, 255, 100)),
(front, color(0, 255, 255, 100)),
)
for pts, shade in faces:
hs = side / 2 # half side
fill(shade)
beginShape()
for pt in pts:
x, y, z = pt
vertex(x * hs, y * hs, z * hs)
endShape(CLOSE)