Skip to content

Commit 9483770

Browse files
Merge pull request #133 from BruceSherwood/Update_no_notebook_demos
Update some of the no-notebook demo programs
2 parents bc1aebf + c44f090 commit 9483770

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Demos_no_notebook/Bounce.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@
3434
ball.p.y = -ball.p.y
3535
if not (side > ball.pos.z > -side):
3636
ball.p.z = -ball.p.z
37+

Demos_no_notebook/RotatingBoxes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from vpython import *
2-
from time import clock
32

43
N = 10
54

Demos_no_notebook/RotatingPoints.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ def Runbutton(b):
2727
next = last+0.1*vec.random()
2828
while mag(next) > 1: # if next is outside the sphere, try another random value
2929
next = last+0.1*vec.random()
30-
p.append({'pos':next, 'radius':0.002+0.04*random(), 'color':(vec(1,1,1)+vec.random())/2})
30+
#p.append({'pos':next, 'radius':0.002+0.04*random(), 'color':(vec(1,1,1)+vec.random())/2})
31+
p.append({'pos':next, 'radius':3+10*random(), 'color':(vec(1,1,1)+vec.random())/2})
3132
last = next
32-
c = points(pos=p, size_units='world')
33+
c = points(pos=p) #, size_units='world')
3334
while True:
3435
rate(60)
3536
if run: # Currently there isn't a way to rotate a points object, so rotate scene.forward:
36-
scene.forward = scene.forward.rotate(angle=-0.005, axis=vec(0,1,0))
37+
scene.forward = scene.forward.rotate(angle=-0.005, axis=vec(0,1,0))

Demos_no_notebook/Rug.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from vpython import *
22
scene.width = scene.height = 600
33
scene.range = 0.6
4-
from time import clock
54

65
# A pulse ripples along a rug, demonstrating dynamic changea of shape
76
# Bruce Sherwood, May 2012

VPythonDemos_no_notebook.zip

7.86 KB
Binary file not shown.

0 commit comments

Comments
 (0)