WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-27-2007, 07:46 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The viz.pick() command returns a Vizard node object. However, you are populating your bodies list with your own Ball objects, which are not node objects. You can iterate through the list and check if the node is equal to the ball attribute of the Ball class. Or you can have your Ball class inherit from the Vizard node object. If you wanted to inherit from a Vizard node your Ball class would look like this:
Code:
class Ball(viz.VizNode):
	def __init__(self, alpha):
		
		self.BALL_ALPHA = alpha
		#Add the geometric representation of the ball
		self.ball = viz.add('ball.wrl')
		#Make ball twice as big
		self.ball.scale(2,2,2)
		#The balls collision will be represented by a sphere
		self.ball.collideSphere()
		#Set the alpha value of the ball
		self.ball.alpha(self.BALL_ALPHA)
		
		#Need to initialize base class
		viz.VizNode.__init__(self,self.ball.id)
Reply With Quote
 


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


All times are GMT -7. The time now is 06:41 AM.


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