PDA

View Full Version : Collision complex shapes


handerson11
12-05-2016, 10:46 AM
Hi,

I am making a realistic assembly process with complex objects and realistic physics. I am currently populating the objects with spheres for collision but it is proving problematic and very time consuming.

Is there a simpler way to detect collision whilst having realistic physics being applied and allowing for grabber tool interaction?

Here is an example of a simple disc:

#Discs
#Disc1
Disc1=viz.addChild('Disc VR Models\Bottom Disc.wrl', euler=(0,90,0), color=viz.GREEN, alpha=1)
#Disc1.collideBox(friction=.001)
RADIUS = 0.075
TUBE_RADIUS = 0.02
for deg in range(0,360,10):
x = math.sin(viz.radians(deg)) * RADIUS
z = math.cos(viz.radians(deg)) * RADIUS
Disc1.collideSphere(radius=TUBE_RADIUS,pos=(x,z,0) )
Disc1.enable(viz.COLLIDE_NOTIFY)
Disc1.crashSound = viz.add('sounds/crashQuiet.wav')
Disc1.setPosition(0,1,1)


Thanks,
Harry Anderson

Jeff
12-05-2016, 02:24 PM
If you don't need the complex model to be affected by forces then you could use a collide mesh to detect when other objects collide with it.

handerson11
12-06-2016, 02:31 AM
I need it to be acted on by gravity.
Is there any way to program the mesh to be acted on by gravity?
Or is there another way to make the parts seem like gravity is acting on them?

handerson11
12-06-2016, 08:18 AM
It needs to be acted on by gravity and not intersect other objects when being grabbed.

Jeff
12-06-2016, 11:13 AM
The collide mesh will not react to gravity. You could use the vizact.fall (http://docs.worldviz.com/vizard/#commands/vizact/fall.htm) command to create a falling animation.

handerson11
12-08-2016, 10:06 AM
Hi Jeff thanks again,
I was trying to get the objects to fall realistically which is something that is key in my program, also I need objects to fall on top of each other as they would in real life.