1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 true true true false false 2 5 1 0 0 0 0.69999999999999996 0 0 0 0.69999999999999996 0.40000000000000002 0.40000000000000002 0.40000000000000002 $K3D_SHARE_PATH 12 4 0.80000000000000004 0.80000000000000004 0.80000000000000004 false 0 100 true false true false true true true 4 0 4 30 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 true 6 0 0 0 false false -0.6666666666666666 0.6666666666666666 0.5 -0.5 1 1000 0 1 0 1 false 0 0 0 0.69999999999999996 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.71887845122661098 0.21628448743086429 0.66063211612727202 -17.788064111156906 0.69513579418846594 -0.22367177557035534 -0.68319628544890043 18.395622963822156 2.2594773274597912e-15 0.9503641182778173 -0.31113990854602225 8.3776984279855427 0 0 0 1 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 $K3D_SHARE_PATH 1 0.5 0.5 0.1 1 1 1 26 0 0 0 0 false 1 1 1 1 1 1 1 $K3D_SHARE_PATH 3000 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 true 28 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 -20 0 1 0 20 0 0 1 30 0 0 0 1 27 35 29 32 320 240 1 0 0 0 0 16 16 256 10 1024 false 3 3 gaussian 2 2 1 1 false 0.3 1.6 30 1 constant true false false node_selection 36 1 true 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 true 0 0 0 0.5 0.5 0.5 1 1 1 1 0 0 true 0 0 0 0.5 0.5 0.5 1 1 1 1 0 0 true 0.20000000000000001 0.20000000000000001 0.20000000000000001 0.5 0.5 0.5 0.59999999999999998 0.59999999999999998 0.59999999999999998 1 0 0 true 0 0 0 0.5 0.5 0.5 1 1 1 1 0 0 2 true 0 0 0 0.5 0.5 0.5 1 1 1 1 0 0 2 true 0.20000000000000001 0.20000000000000001 0.20000000000000001 0.5 0.5 0.5 0.59999999999999998 0.59999999999999998 0.59999999999999998 1 0 0 2 true true true true true true true true true true false 0 1 1 0 0.59999999999999998 0.59999999999999998 true true false 0 1 1 0 0.59999999999999998 0.59999999999999998 true true true true true true true true 31 1 1 1 5 5 5 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 true true false true 37 8 false 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 #python import k3d import ode def is_physical_node(node): if node.factory().name() != "FrozenTransformation": return False if not node.has_property("mass"): return False if not node.has_property("linear_velocity"): return False return True if not locals().has_key("last_time"): last_time = Node.time world = ode.World() world.setGravity(Node.gravity) physical_nodes = {} for node in Document.nodes(): if not is_physical_node(node): continue mass = ode.Mass() mass.setSphereTotal(node.mass, 1.0) body = ode.Body(world) body.setMass(mass) body.setPosition(node.output_matrix * k3d.point3(0, 0, 0)) body.setLinearVel(node.linear_velocity) physical_nodes[node] = body delta_time = Node.time - last_time last_time = Node.time if delta_time > 0: world.step(delta_time) for node in physical_nodes.keys(): body = physical_nodes[node] resting_position = node.input_matrix * k3d.point3(0, 0, 0) current_position = node.output_matrix * k3d.point3(0, 0, 0) new_position = body.getPosition() delta_position = k3d.point3(new_position[0], new_position[1], new_position[2]) - resting_position node.matrix = k3d.translate3(delta_position) node.linear_velocity = body.getLinearVel() else: for node in physical_nodes.keys(): node.matrix = k3d.identity3() node.linear_velocity = k3d.vector3(0, 0, 0) 0 0 0 -9.8100000000000005