WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-23-2008, 03:27 AM
dan12345 dan12345 is offline
Member
 
Join Date: Jan 2008
Posts: 58
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
Reply With Quote
  #2  
Old 05-23-2008, 06:14 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
inheritence question theuberk Vizard 3 01-10-2008 07:01 AM


All times are GMT -7. The time now is 10:31 AM.


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