#1
|
|||
|
|||
chain mesh collisions
Hi!
I have a chain link ( a plane, with transparent texturing ). I am trying to make a complete chain out of links programatically. This works fine, however, when I try to simulate the chain hanging and swaying (by attaching one end to a joint, and setting "Collide Mesh"), vizard locks up completely. I don't want the chain to bend at each link, just at the point from which it is hanging (the chain is supposed to be under high load, so lots of flopping around would be unrealistic). I assume vizard locks up because the chainlink meshes technically intersect one another. Is there a way to apply gravity to an object WITHOUT giving it a collide<Type>() command? Code follows: Code:
import viz import math # distance is meters # mass is in kilograms # gravity is 9.81 m/s viz.go() viz.phys.enable() viz.phys.setGravity([0, -9.81, 0]) viz.startlayer(viz.LINE_STRIP) viz.vertexcolor([1,1,1]) viz.vertex([0,0,0]) viz.vertex([0,0,4]) viz.endlayer() def create_axes(length, parent): viz.startlayer(viz.LINE_STRIP) viz.vertexcolor([0,0,1]) viz.vertex([0,0,0]) viz.vertex([0,0,length]) viz.vertexcolor([0,1,0]) viz.vertex([0,0,0]) viz.vertex([0,length,0]) viz.vertexcolor([1,0,0]) viz.vertex([0,0,0]) viz.vertex([length,0,0]) object = viz.endlayer() if(parent != 0): object.parent(parent) return object def create_chain(length): link_count = length / 0.1 + 1 a = 0 head = 0 plink = 0 while(a < link_count): if(head == 0): head = viz.add('data\\chainlinks.IVE') head.setScale([0.0142,0.0142,0.0142]) head.collideMesh() plink = head else: link = viz.add('data\\chainlinks.IVE') link.collideMesh() link.parent(plink) link.setPosition([0,0,7]) link.setEuler([0,0,90]) plink = link a=a+1 return head chain = create_chain(4.0) #chain.setEuler([0,90,0]) chain.setPosition([0,4,0]) joint = viz.phys.addBallJoint(chain, None, pos = [0,4,0]) create_axes(100, chain) create_axes(1, 0) viz.MainView.setPosition([5,2,5]) viz.MainView.lookat([0,2,0]) |
#2
|
|||
|
|||
Can you attach the .ive file used for this script or upload to http://www.worldviz.com/support/upload.html?
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Head mesh indirection | Enlil | Vizard | 2 | 07-08-2010 08:11 AM |
Avatar bones show through Mesh. | vEsotu | Vizard | 3 | 11-03-2008 11:38 AM |
Multiple Mesh Avatar Texturing | v-jbinney | Vizard | 6 | 11-13-2007 11:00 AM |
LOD per individual mesh?? | krimble | Vizard | 4 | 01-15-2007 04:46 AM |
changing the texture of an avatars shirt/body | bailenson | Vizard | 19 | 05-04-2006 10:00 AM |