WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-05-2007, 05:04 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Collision?

Hi. I need a little help. I believe collisions is what I need to use, but I'm not sure how.

I need to make a world with a box with holes of different sizes and I want the user to pick up a screw using the haptic pen and be able to screw it into th ebox. I only want the screw to be able to go through in the right sized hole.

Right now the screw can go through the box anywhere! I set the hardness of the box to be 1 on the haptic device, so the haptic pen can't get through the box but if the screw is bigger than the marker of the pen then it just goes right through. How can I achieve the effect I want?

Should I somehow manually get the colliding object of the screw and box and do the math myself to figure out when they intersect or is there an easier way?

Thanks so much!
Reply With Quote
  #2  
Old 07-06-2007, 10:17 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

I don't think OpenHaptics supports arbitray shapes for the pen, it can only be a point. You can use Vizard collision routines to detect when the two objects are touching and manually apply a force to the haptic pen. Take a look at the viz.phys.intersectNode command for detecting collisions. For applying forces to the haptics pen take a look at the downloads page under "Hardware Support". There is a "Haptic Effects" download. It contains some example of using certain haptic effects, which includes applying a constant force. You DO NOT need the modified hd.dlm/hd.py plugin that is included with the zip file, it is only for Vizard 2.5.
Reply With Quote
  #3  
Old 07-08-2007, 05:19 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Sweet. Thanks for the reply. I'll look into those options. This is more complicated than I thought!
Reply With Quote
  #4  
Old 07-10-2007, 03:19 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Quote:
Originally Posted by farshizzo View Post
Hi,

I don't think OpenHaptics supports arbitray shapes for the pen, it can only be a point. You can use Vizard collision routines to detect when the two objects are touching and manually apply a force to the haptic pen. Take a look at the viz.phys.intersectNode command for detecting collisions. For applying forces to the haptics pen take a look at the downloads page under "Hardware Support". There is a "Haptic Effects" download. It contains some example of using certain haptic effects, which includes applying a constant force. You DO NOT need the modified hd.dlm/hd.py plugin that is included with the zip file, it is only for Vizard 2.5.
Hi. I just tried this but the haptic pen stops working when I add in the collision code. I added a collsion mesh to the box with holes and capsules around each screw. I added a calback where when a screw hits the box the box should turn red for now. (debugging). I disabled dynamics on the screws so they don't fall off the screen. However, the haptic pen is stuck. I see the marker but it doesn't follow the haptic pen. Can I have both a collision callback and use the haptic pen callbacks at the same time?
Reply With Quote
  #5  
Old 07-11-2007, 10:46 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Are you enabling physics? If you just want to perform collision tests there is no need to enable physics and disable dynamics. Also, can you post a simple script that reproduces the problem. If you wish, you can send the files directly to me at lashkari@worldviz.com
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


All times are GMT -7. The time now is 03:24 AM.


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