PDA

View Full Version : Collision?


mjabon
07-05-2007, 04:04 PM
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!

farshizzo
07-06-2007, 09:17 AM
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.

mjabon
07-08-2007, 04:19 PM
Sweet. Thanks for the reply. I'll look into those options. This is more complicated than I thought!

mjabon
07-10-2007, 02:19 PM
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?

farshizzo
07-11-2007, 09:46 AM
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