|
From: Arthur <ajs...@op...> - 2004-08-01 14:06:38
|
Jonathan, Bruce -
Thanks for the efforts that brought us VPython 3.0!
What I am most excited about is the ability to now subclasss cvisual classes
directly in Python. Since the facility is undocumented at this point, I
thought I'd bring it to the attention of the community of VPython users.
A trivial example, of a complete scene with a sphere that defaults to being
blue, instead of the VPython standard white:
import cvisual
import time
import atexit
def __waitclose():
while not cvisual.allclosed(): time.sleep(0.05)
atexit.register(__waitclose)
scene = cvisual.display()
class bluesphere (cvisual.sphere):
def __init__( self,*args,**keywords):
cvisual.sphere.__init__(self)
self.color=(0,0,1)
self.complete_init( self, self,
1, scene, None)
bluesphere()
I would hope that an eventual documentation of the API for subclassing from
cvisual (and perhaps some refinement of it) will unleash the VPtyhon
community's creative exploration of the possibilities inherent in this
facility.
Art
|