View Single Post
  #2  
Old 11-01-2012, 06:44 AM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
I see the ring question has been answered here.

However, I would still benefit from someone helping with my first question. How do I get rid of initial "bounce" and "wobble" of a node?

Here's another example to demonstrate my question:
If I have a ball sitting atop a hole which is slightly smaller than the diameter of the ball, and gravity or a force is enabled, my ball doesn't "sit still" atop the hole. Rather, it wobbles around the hole for several seconds until it eventually slows down and sits atop the hole. If the collision plane and ball is perpendicular to gravity, shouldn't the ball's position remain initially constant and not wobble around?

My attached pictures shows one of the balls wobbling around the hole instead of its position remaining constant.

Code:
viz.add('shaft.dae', pos = (0,0,0))
base = viz.add('base.dae', scale=[1,1,1],euler=[0,0,0], pos = (-2.5,0,-2))
base.texture(pic_base)

# add spheres
sphere1 = viz.addChild('ball.dae', viz.WORLD, pos = (-.65,.17,.84), scale=[0.4,0.4,0.4],euler=[0,0,0], texture=(pic_sphere))
sphere2 = viz.addChild('ball.dae', viz.WORLD, pos = (-.65,.2,-.19), scale=[0.4,0.4,0.4],euler=[0,0,0], texture=(pic_sphere))
sphere3 = viz.addChild('ball.dae', viz.WORLD, pos = (-.65,.2,-1.18), scale=[0.4,0.4,0.4],euler=[0,0,0], texture=(pic_sphere))
sphere4 = viz.addChild('ball.dae', viz.WORLD, pos = (-1.64,.2,.82), scale=[0.4,0.4,0.4],euler=[0,0,0], texture=(pic_sphere))
sphere5 = viz.addChild('ball.dae',viz.WORLD, pos = (-1.64,.2,-.19), scale=[0.4,0.4,0.4],euler=[0,0,0], texture=(pic_sphere))
sphere6 = viz.addChild('ball.dae', viz.WORLD, pos = (-1.64,.2,-1.18), scale=[0.4,0.4,0.4],euler=[0,0,0], texture=(pic_sphere))

base.collideMesh() 
viz.phys.setGravity(0,-10,0) #world gravity
sphere1.collideSphere(bounce = 0)  
#sphere1.applyForce([0,0,-2])
#ringPhys = sphere2.collideSphere(bounce = 0)  
#ringPhys = sphere3.collideSphere(bounce = 0)  
#ringPhys = sphere4.collideSphere(bounce = 0)  
#ringPhys = sphere5.collideSphere(bounce = 0)  
#ringPhys = sphere6.collideSphere(bounce = 0)  

#linking
link = None #The handle to the link object

#Grab or let go of the ring
def toggleLink():
	global link
	if link:
		#If link exits, stop grabbing
		link.remove()
		link = None
	else:
		#If no link, grab the circle with the shaft(parent + grasper tip (children))
		link = viz.grab(shaft, sphere1)
vizact.onkeydown(' ',toggleLink)

vizact.whilekeydown(viz.KEY_UP,shaft.setPosition,[0,vizact.elapsed(1),0],viz.REL_PARENT)
vizact.whilekeydown(viz.KEY_DOWN,shaft.setPosition,[0,vizact.elapsed(-1),0],viz.REL_PARENT)
vizact.whilekeydown(viz.KEY_RIGHT,shaft.setPosition,[vizact.elapsed(1),0,0],viz.REL_PARENT)
vizact.whilekeydown(viz.KEY_LEFT,shaft.setPosition,[vizact.elapsed(-1),0,0],viz.REL_PARENT)
Attached Thumbnails
Click image for larger version

Name:	wobble.JPG
Views:	882
Size:	58.7 KB
ID:	544  
Reply With Quote