[Edu-sig] re: 3d in Python
Terry Hancock
hancock@anansispaceworks.com
Mon, 28 Apr 2003 14:39:25 -0700
Hi all,
Regarding "interactive" VPython on the web, this wouldn't
be too hard with a Zope product -- or even just an external
method:
o HTML form to enter VPython code, and an
Image which represents the result.
o Type a line of code/VPython-command at the end of
the script window. Press a "submit" button.
o After a few seconds, get the same form back, with the
extra command and the updated image.
o Repeat.
Naturally, you could add features to make it play back in
a less interactive way, a palette to express common function
calls etc (i.e. you push the button and the function is
typed into the window -- using Javascript -- to remind you
of what the syntax looks like), and so on.
What it would do is create a browser-based interface to
VPython so the user doesn't have to have it installed on
their machine. The downside of course, is that you
(whoever's running the server) have to pay for all the CPU
cycles involved and the bandwidth used is pretty high
(because you ship a different image to the browser
after every step). So a *good* design would probably
consider the overload failure mode you want to see (i.e.
what your server should do if there are too many people
using it). It might not matter in an academic setting,
though (plenty of CPU, large bandwidth, few users).
Will VPython run with Python 2.1.3? If it requires 2.2,
this would be just a bit harder with the current Zope
releases, since AFAIK Zope still needs 2.1. Also, you need
to be able to render to an image (i.e. use VPython in
a "batch mode") rather than the screen. Does that
make sense?
Cheers,
Terry
--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com