WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-25-2008, 10:54 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Sorry for the delay, but we just got our Phantom Omni in for testing. I tried it out and have the same problems as you. It seems the problem is related to the fact that the center of the cylinder object is not at the local origin of the object. This is causing problems with the physics engine and creating large angular acceleration values. I created a separate cylinder model that was centered properly and now it works fine. Here is the WRL text for the new cylinder object:
Code:
Transform {
	rotation 1 0 0 1.5707963267948966
	children [
		Shape {
			appearance Appearance {
				material Material {
					diffuseColor 0.8353 0.6039 0.898
				}
			}
			geometry Cylinder { radius 0.05 height 0.5 }
		}
	]
}
Save this to a file called pen.wrl and place it in the same directory as the following script:
Code:
import viz
import hd

viz.go()
viz.phys.enable()
viz.phys.setGravity(0,0,0)

cyl = viz.add('pen.wrl')
cyl.collideBox([1,1,1])

marker = viz.add('marker.wrl')
marker.scale(0.1,0.1,0.1)
hd.marker(marker)
hd.translate(0,2,5)

spring = cyl.addSpring(viz.LINK_ORI|viz.LINK_POS,linearKd=10,linearKs=100,angularKd=1,angularKs=20)

def UpdateSpring():
	spring.setPosition(hd.get(hd.POSITION))
	spring.setQuat(hd.get(hd.ROTATION))
vizact.ontimer(0,UpdateSpring)
Let me know if this solves your problems.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Physics and Haptics jalvarez Vizard 3 07-16-2008 03:03 PM


All times are GMT -7. The time now is 04:12 PM.


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