[Edu-sig] JPython and CP4E

Jason Cunliffe jasonic@nomadicsltd.com
Mon, 9 Oct 2000 19:39:11 -0400


Hi Art

From: Arthur Siegel <ajs@ix.netcom.com>

> For starters, the kind of list of Python resources that Jason recently
> posted up for graphics expands exponentially when one includes  the
ability
> to use JPython. Java3D, for example, is very well accessible to Python
code
> via JPython. The reality is that there are vaster Java than Python
resources
> in most every category.  I found it liberating to know I could explore the
> Java world of resources while staying close to home,
>  being Python.

Since getting into Python, Java looks more approachable to me.
Plus I have seen the graphics stuff improve. I was kind of burned on a
project 3 years ago which tried to use Java too soon to some interactive
graphics. But 3 years is a long in Internet time
I was not successful in JPython last time I tried either.. don't why some
paths or installs did not come together right.

> I am trying to design what I am doing in Java to be easily scriptable in
> JPython - the beauty being that if your Java classes are designed to
qualify
> as beans, than you can use normal Python keyword syntax to set the class's
> attributes on initialization.  (I think I said that right).

Python in Java is great idea...
What I never managed to figure out  is:
1. does JPython give you a Python command line shell in a web browser ?
2. which can access java classes stored on web server?

Playing with the JPython 3D demos you sent me Art, reminded me of several
things and raised some questions of where your JPython might go...

<quick background context>
A couple of years ago, before I knew about Python, I spent quite a bit of
time looking into 'Mathematica'.
I love its design philosophy, its graphics, the Notebooks and the rigor of
Wolfram's team.
But they were waking up slowly adn carefully  to the web.
Mathematica is very expensive if you step outside of the academic bandwidth
they bless, or are a nomad independent as I am. Their license is machine
specific.

The Math department of Imperial College in London had a hard time
[financially] negotiating acceptable licenses. Alas I think this nixed
Mathematica there after several years good development of new curriculum.
This not necessarily Wolfram's fault, because UK academic budgets and
departmental management may be very hard to understand from Urbana. But they
did not help them either..
I was luckier  the UK office in Oxford kindly extended me developer license
status for some time while I tried to get Mathematica to extend its 3D
interactive capabilities. With a Mathematica programmer, we developed a
package for visualizing generic nested timelines in 3D - with a view to
output as VRML2.0. Partially successful. Then I found an openGL tool
developed by the same team who now make MathEngine
http://www.mathengine.com/

Then discovered LiveGraphics3D - the clever work of Martin Kraus
http://wwwvis.informatik.uni-stuttgart.de/~kraus/ who developed a pioneering
Java3D applet for interactive rendering of Mathematics 3D graphics objects.
This was really a much better solution than our VRML one, because it allowed
direct use of Mathematica's own Graphics3D format as ASCII script. Just cut
and paste.
</quick background context>

The applet has improved quite a bit since then and has color and some nice
interactive querying features.

Docs
http://wwwvis.informatik.uni-stuttgart.de/~kraus/LiveGraphics3D/documentatio
n.html
user action  ~  applet reaction
dragging (left mouse button pressed) rotating about an axis in the picture
releasing left mouse button while dragging  spinning about an axis in the
picture
SHIFT key pressed plus vertical dragging  zooming
SHIFT key pressed plus horizontal dragging  rotating about an axis
perpendicular to the picture
CONTROL key pressed plus vertical dragging  changing focal length
CONTROL key pressed plus horizontal dragging  changing strength of stereo
effect
META (ALT) key (or right mouse button) pressed plus vertical dragging
stripping parts of the graphics
"o" key  printing parameter settings to the Java console (aka Java messages
window)
"s" key  toggling between single picture, stereo pictures for diverge fusing
and stereo pictures for cross fusing


You can see LiveGraphics3D on Mathsource
http://www.mathsource.com/Content/Enhancements/Interfacing/Web/0209-281

or go direct to Martin Kraus' own site:
http://wwwvis.informatik.uni-stuttgart.de/~kraus/LiveGraphics3D/index.html
with examples
http://wwwvis.informatik.uni-stuttgart.de/~kraus/LiveGraphics3D/examples.htm
l

See what others have done with it
http://wwwvis.informatik.uni-stuttgart.de/~kraus/LiveGraphics3D/links.html

and good work continues...
Hidekazu Takahashi has added a 3D knife to slice objects:
http://www2.kawase-h.ed.jp/Teachers/~Takahashi/Knife.html


I still have a recurring  fantasy that next Tuesday or the one after  Steven
Wolfram will get gently struck by a Robert Crumb meatball, and open up
Mathematica, giving source away to all the schools in the world. But it may
be too late. And now with Python and NumPy and more it looks increasingly
like that may not be needed or even such a good idea... Mathematica is
brilliant, but locked in somewhat by its own god and universe. I admire them
for sticking to their guns.. but in the long run I think everyone loses.
There's is still much to be learned from it. For example JLink which lets
you load Java classes into Mathematica, or create and run Java code from
Mathematica code.
http://www.wolfram.com/solutions/mathlink/jlink/
Also Python connectivity [1998]
http://www.mathsource.com/Content/Enhancements/Interfacing/Other/0209-292

What can we learn / use from this?
So I wonder what kind of connectivity you envision between JPython 3D  and
[regular] Python?
What kinds of transfer for objects and work would you like to see?

best wishes
  Jason