[Edu-sig] 3D in Python (was Re: Pytoon)
Dethe Elza
delza@blastradius.com
Fri, 25 Apr 2003 09:20:58 -0700
Art,
Is there any reason you can't drive VPython with XML-RPC? Why do you
need SVG?
SVG is an inherently 2-D format, basically display PostScript with
angle brackets. While you can certainly generate 3D on such a platform
(it all ends up in 2D at some point), it's a serious load of work (I
did a simple 3D app using nothing but Java AWT and it was a pain in the
keister), and (perhaps more importantly) you lose all the efficiencies
of OpenGL (which is mostly rendered in specialized hardware these days).
If you have a need for 3D using XML, I'd recommend taking a look at
X3D[1] from the Web3D Consortium, and the standards which build on it:
GeoVRML[2] for specifying large, outdoor scenes, and H-Anim[3] for
humanoid animation. X3D is the re-working of VRML in XML, and while
VRML has a bad rep for being inconsistently implemented, it still
presents one of the lower barriers to entry of the 3D standards. By
using XML for 3D you also get access to the standard XML DOM for
manipulations and animation (which can be good or bad, depending on
your feelings about the DOM).
On the other hand, if you need to do 3D beyond what VPython provides,
but you don't care about the XML aspect of SVG, there quite a number of
tools for 3D which have Python bindings. The grand-daddy of them all
is PyOpenGL[4], which gives you complete access to the native OpenGL
API (an absolute beast, but it does the job). The PyOpenGL project
also has a subproject, OpenGLContext[5], which is a learning
environment for OpenGL, much more accessible than raw OpenGL (closer to
VPython), and has a tool for importing VRML documents.
Other 3D Libraries with Python bindings include VTK[6],
CrystalSpace[7], Blender[8], and on the commercial front the Poser[9]
character animation program (version 5) is scriptable with Python.
[1] Extensible 3D Graphics
http://www.web3d.org/x3d.html
[2] Geographical Data in VRML
http://www.geovrml.org/
[3] Specification for a standard humanoid
http://www.h-anim.org/Specifications/H-Anim1.1/
[4] The Python OpenGL Binding
http://pyopengl.sourceforge.net/
[5] A Learning Environment for PyOpenGL and Python 2.2.x
http://pyopengl.sourceforge.net/context/index.html
[6] The Visualization Toolkit
http://www.vtk.org/
[7] CrystalSpace game development kit
http://crystal.sourceforge.net/drupal/
[8] Blender 3D
http://www.blender3d.com/
[9] Poser 5 Character Animation Solution
http://www.curiouslabs.com/
--Dethe
On Friday, April 25, 2003, at 05:57 AM, Arthur wrote:
>> I have posted about the possibility of a Python Applet Player
>> infrastructure to deploy C-Python applets (maybe
>> built on PyGame?)
>
> and following cites.
>
> Lot's to digest. Please keep us/me posted. I will probably have some
> specific questions once I have had a chance to digest more.
>
> Off to the side - maybe you/ others might save me from going down a
> dead-end. Is there
> anything in this general area that might be put together using xmlrpc
> and/or SVG? I am
> specifically interested in 3d stuff. But the 3d functionality I need
> is quite basic - just
> a few primtives to work with - spheres, lines, etc. Essentially what
> is native to VPython,
> which is why it has been such a fortuitous match to my needs. I guess
> my understanding is
> that SVG is not natively 3d, but I have seem some demos of decent, but
> basic 3d web-based SVG renderiong.
>
> Python libraries exist that would handle all this well, I believe, if
> there is anything
> feasible to be done here.
>
> ?
>
> Art
>
>
>
>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>