-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtestAnimation.py
More file actions
27 lines (20 loc) · 765 Bytes
/
testAnimation.py
File metadata and controls
27 lines (20 loc) · 765 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
import wireframe as wf
import wireframeDisplay as wd
class AnimatedWireframe(wf.Wireframe):
def update(self):
self.translate([0,1,0])
ball = wf.getSpheroid((200,200,300), (30,30,30), 16)
animated_ball = AnimatedWireframe()
animated_ball.nodes = ball.nodes
animated_ball.edges = ball.edges
width, height = 600, 400
viewer = wd.WireframeViewer(width, height)
viewer.addWireframe('floor', wf.getHorizontalGrid((0,height,0), (50,50), (12,12)))
viewer.addWireframe('ball', animated_ball)
# Eye starts at (width/2, height/2, 0). Move to (width/2, height-50, 0)
viewer.translate([0,-150,0])
# Change depending on screen size and now much the eye can fit in view
field_of_view = 0.25
viewer.scale(1/field_of_view)
#viewer.perspective = False
viewer.run()