forked from hnhaefliger/pyengine3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgalleonExample.py
More file actions
36 lines (28 loc) · 843 Bytes
/
galleonExample.py
File metadata and controls
36 lines (28 loc) · 843 Bytes
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
### Galleon ###
import graphics.engine
points = []
triangles = []
with open('coords/GalleonV.txt', 'r') as f:
lines = f.readlines()
for line in lines:
coords = line[:-2].split(' ')
points.append([float(coords[0])/150, float(coords[1])/150, float(coords[2])/150])
f.close()
with open('coords/GalleonT.txt', 'r') as f:
lines = f.readlines()
for line in lines:
coords = line[:-2].split(' ')
newCoords = []
for coord in coords[1:4]:
newCoords.append(int(coord))
triangles.append(newCoords)
f.close()
test = graphics.engine.Engine3D(points, triangles, distance=100, title='Galleon')
def animation():
test.clear()
test.rotate('y', 0.1)
test.render()
test.screen.after(1, animation)
animation()
test.screen.window.mainloop()
################