WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Hand model collision detection. (https://forum.worldviz.com/showthread.php?t=1489)

Lotar 05-11-2008 02:22 PM

Hand model collision detection.
 
Hi,

is it possible to detect collision between specific bone of the 5DT glove's hand model and some other objects ? When I try to apply collision mesh directly on a specific bone, it says that VizBone object has no attribute collideMesh. Is there some other way, then ?

farshizzo 05-12-2008 04:14 PM

You cannot perform collision on bones, only the entire avatar mesh. Are you trying to detect when the fingers touch something? If so, you can create an empty group node with a collision shape similar to the finger, then before performing collision detection you can manually place the group node at the current finger bone location. Either way, if you can describe what you are trying to accomplish I can provide you with some sample code.

rubberpimple 08-29-2008 04:43 PM

Hi farshizzo,

I'd love to see the code for this. I'm trying to do collision detection between a hand model and specific child nodes of a parent object. Did I read somewhere that I can only do collision detection on nodes that are children of viz.WORLD?

Moh200jo 04-23-2009 07:44 AM

Quote:

Originally Posted by rubberpimple (Post 6213)
Hi farshizzo,

I'd love to see the code for this. I'm trying to do collision detection between a hand model and specific child nodes of a parent object. Did I read somewhere that I can only do collision detection on nodes that are children of viz.WORLD?

Hi David,
Have you got the code of bone collision?
Thanks in advance.

Jeff 04-23-2009 10:26 AM

Here's the thread that has a response to this question

Moh200jo 04-23-2009 11:08 AM

I have tried with the following code; does not work
HTML Code:

import viz

viz.go()

viz.add('tut_ground.wrl')
#Add the ground and an avatar.
avatar = viz.addAvatar( 'vcc_female.cfg' )
ball=viz.add('ball.wrl')
ball.setPosition(0,0.1,9)
ball.collideSphere()
ball.enable(viz.COLLIDE_NOTIFY)
walk=vizact.walkTo([0,0,8.99])
avatar.addAction(walk)
boneCollide = viz.addGroup()
boneCollide.collideBox([.5,.1,.5])
foot=avatar.getBone('Bip01 R Foot')
boneCollide.setPosition(foot.getPosition(viz.AVATAR_WORLD))
boneCollide.setQuat(foot.getQuat(viz.AVATAR_WORLD))
nodes = viz.phys.intersectNode(boneCollide)
for n in nodes:
    print 'bone collided with',n


Jeff 04-23-2009 12:18 PM

If you want to have collisions with the avatar's foot I think the code that Farshizzo posted in this thread will help. In that example a collision box is linked to an avatar's hand.


All times are GMT -7. The time now is 11:14 PM.

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