#1
|
|||
|
|||
Using 2 slider joints to move on a plane
Hey there,
I'm working on a project where I need to use a portalcrane where the mounted object is moved by grabbing it with the vizconnect grabber and the parts of the crane should move too. I want to use the built-in physics engine, so i tried to use multiple joints to connect the crane parts, but I didn't figure out yet, how I could use 2 slider joints to get the crane moving in the room. Is there a way to do this? This is an example code I use for testing purposes: Code:
# ----------------------------------------------------------------------- # Options CYCLES_PER_SEC = 0.05 # Frames viz.setMultiSample(4) # Multisampling viz.setOption('viz.max_frame_rate', 60) # Avoid flickering viz.vsync(viz.OFF) # V-Sync viz.collision(viz.ON) # Viewport Collision viz.phys.enable() # Physics Simulation viz.setOption('viz.model.cache', viz.CACHE_CLONE) vizconnect.go(r'../vizconnect_files/keyboard.py') # Standard Vizconnect Keyboard Setting # ----------------------------------------------------------------------- # Loading of Objects grabber = vizconnect.getRawTool('grabber') position = [5.0, 0, 0] room = viz.add('lab.osgb') # Room is loaded room.collideMesh() # Room gets Collision box = vizshape.addBox(size=[12.8, 0.2, 0.2], pos=[0, 5.5, position[2]]) box.collideBox() box_joint = viz.phys.addSliderJoint(box, None, pos=[0, 5.5, position[2]], axis0=(0, 0, 1)) box_joint.setAxisLimit(0, -6, 6) # Limit sliding distance box_joint.setAxisBounce(0, 0) # Change end bounce properties rope = vizshape.addBox(size=[0.075, 3, 0.075], pos=[position[0], 3.9, position[2]]) rope.collideBox() rope_joint = viz.phys.addSliderJoint(rope, None, pos=[position[0], 3.9, position[2]], axis0=(1, 0, 0)) rope_joint.setAxisLimit(0, -12.8 / 2 - position[0],12.8 / 2 - position[0]) # Limit sliding distance rope_joint.setAxisBounce(0, 0) # Change end bounce properties # rope_box_joint = viz.phys.addFixedJoint(box, rope) grabber.addItems([rope]) |
#2
|
|||
|
|||
I'll check with a developer but I'm not sure if this is possible using the physics engine. It may require IK code that moves the joints based on the object's position.
|
#3
|
|||
|
|||
Is there some way you can show how you expect the objects to move together, maybe a diagram or picture.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Slider Assistance | new_horizon | Vizard | 3 | 05-16-2012 08:32 AM |
Tiling a texture on a plane | FreakyT | Vizard | 2 | 04-27-2011 06:34 PM |
adding more than 1 action for avatar animation slider control | yak | Vizard | 0 | 07-21-2009 12:22 PM |
Vizmenu slider bug? | Gladsomebeast | Vizard | 2 | 10-22-2008 09:05 PM |
I need help with the Far Clip Plane... | k_iwan | Vizard | 3 | 03-13-2007 05:54 AM |