PDA

View Full Version : Inheritence with node3d


dan12345
05-23-2008, 03:27 AM
I wanted to create my own object ( a table, a few children nodes connected
to it, and a few children nodes connected to them ), and to
extend the functionlaties of my object, whilst keeping all the node3d
functions ( such as visible, rotate, etc... ) available.

So is it possible to inherit from the node3d class? If so, how do i do it?
thanks

farshizzo
05-23-2008, 06:14 PM
Sure, the following code show a basic example:
class MyNode(viz.VizNode):
def __init__(self):

base = viz.add('model.ive')

viz.VizNode.__init__(self,base.id)

#Add child
self.child = viz.add('ball.wrl',parent=self)


mynode = MyNode()
mynode.visible(0)