PDA

View Full Version : use vizard object oriented


Johannes
01-11-2005, 12:36 PM
If I want to create Ball-Objects e.g.

class Ball:
def __init__(self,ballName):
self.speed = 0
self._name=ballName
self.x0=0
self.y0=2
self.z0=1
self.alpha=0
self.ball = viz.add('../resources/models/ball.wrl')
def translate1 (self):
self.ball.translate(self.x0, self.y0, self.z0)
def collidingwith (self, object, eins=1):
self.ball.collidingwith(object, eins)


Do I have to define all vizard-built-in-functions again (as in the code example translate or collidingwith - or is there an easier way to do it?

Johannes

farshizzo
01-11-2005, 12:50 PM
Hi,

The following link describes how to create subclasses of Vizard objects. I believe this will answer your question:

http://www.worldviz.com/forum/showthread.php3?s=&threadid=241

Johannes
01-11-2005, 02:56 PM
Thank you!