how to unpause after using new zoom functions on a graph?

9 views
Skip to first unread message

W. Brian Lane

unread,
Feb 1, 2018, 3:57:20 PM2/1/18
to Glowscript Users
I was trying out the new zoom and pan mouse functions on a graph, and learned that if I use either of these tools while the code is running (i.e., before the while loop terminates), the code will pause. Is there a way to unpause and resume the code running?

Brian

Bruce Sherwood

unread,
Feb 1, 2018, 4:16:25 PM2/1/18
to Glowscript Users
Interesting point. I had missed this effect. I just looked at a couple of cases. In both of them the 3D animation keeps going all the time; the while loop doesn't stop. In one of them, the gvbars graph doesn't change while I'm panning but it starts up again when I release the mouse button. In the other case, where gcurves are plotting values vs. increasing time, if I pan the graph no more segments are ever added to the graph, even after releasing the mouse button.

Can you provide a short program that shows the effect you see, as it sounds different from what I see? Thanks.

Bruce

W. Brian Lane

unread,
Feb 1, 2018, 4:25:18 PM2/1/18
to glowscri...@googlegroups.com
Here's the code I was running:

GlowScript 2.7 VPython

graph( fast=False )

g1 = gcurve( color=color.red, markers=True )

x  = 0
dx = 0.1
while(x<pi):
    rate(10)
    g1.plot( pos=(x,sin(exp(cos(x)))) )
    x = x + dx

I didn't have an animation window created, but when I added one, it also continued to animate, so I suppose I was mistaken in saying that the code itself paused.


Bruce Sherwood

unread,
Feb 1, 2018, 4:31:44 PM2/1/18
to Glowscript Users
Thanks. I'll look into what is possible in making this work better.

Bruce

W. Brian Lane

unread,
Feb 1, 2018, 4:32:46 PM2/1/18
to Glowscript Users
  Awesome. Looking forward to it!
Reply all
Reply to author
Forward
0 new messages