WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Inheritence with node3d (https://forum.worldviz.com/showthread.php?t=1507)

dan12345 05-23-2008 03:27 AM

Inheritence with node3d
 
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:
Code:

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)



All times are GMT -7. The time now is 02:00 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC