examples with play, pause, restart

574 views
Skip to first unread message

Aaron Titus

unread,
Jun 25, 2015, 11:58:24 PM6/25/15
to glowscri...@googlegroups.com
I wrote a fairly simple glowscript (vpython) program that demonstrates weighing a brick on earth and weighing the same mass brick on the moon.


I would like to add buttons so the user can play and reset the animation. I saw the example of buttons and sliders at:


The example above is in glowscript javascript. 

Does anyone have an example of a glowscript (vpython) program with play and reset buttons? I would like to embed the simulation into another page. Right now, the glowscript program runs when the page loads. However, I would like the program to draw the scene, pause, and then run after the user presses “play.”

I know I can add buttons within the 3D environment using a box, label, and keyboard interaction. I don’t mind adding the buttons. However, before writing it, I figured I’d find out if anyone has already done this.

Thanks,

Aaron Titus

Bruce Sherwood

unread,
Jun 26, 2015, 12:03:41 AM6/26/15
to glowscri...@googlegroups.com

In the glowscript.org examples is a VPython version right next to the JavaScript version.

Also, there are lots of examples of GUI controls in the new versions of M&I demos at tinyurl.com/MI-physics-demos, all in VPython.

Reply all
Reply to author
Forward
0 new messages