-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyprocessingexample.py
51 lines (29 loc) · 990 Bytes
/
pyprocessingexample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from pyprocessing import *
# playing around with pyprocessing library
def setup():
size(800, 800)
def draw():
vector_list = [[6, -7, 4], [7, -6, 6], [-3, -6, 8], [-4, -5, 5], [-5, 3, 8], [-10, 6, 10], [-6, 2, 6], [-6, 2, 10]]
vector_list_2 = [[-9, 4, 7], [-9, 5, 7], [-7, -2, 6], [-3, -6, 7], [2, -6, 9]]
sum_x = 0
sum_y = 0
sum_z = 0
background(255)
translate(100, 100, 0) # translate resets where origin is
for vector in vector_list:
point(0,0,0)
v = PVector(vector[0], vector[1], vector[2])
line(0,0,0, v.x, v.y, v.z)
translate(v.x, v.y, v.z)
sum_x += v.x
sum_y += v.y
sum_z += v.z
translate(-sum_x+100, -sum_y, -sum_z) # translate resets where origin is
point(0,0,0)
for vector in vector_list_2:
point(0,0,0)
v = PVector(vector[0], vector[1], vector[2])
line(0,0,0, v.x, v.y, v.z)
translate(v.x, v.y, v.z)
def plot():
run()