#1
|
|||
|
|||
Introducing a rotation offset into a link
I am working in a immersive VR simulator, and I am picking up and moving objects around.
Grabbing an object is pretty easy: Code:
grabLink = viz.link(hand,object,1) I can also modify the link to act in a couple different ways by modifying the link like so: Creating a 'locked rotations' link (the grabbed object follows the translations of the hand, but it's orientation is locked at [0,0,0] exactly) Code:
grabLink.setEuler([0,0,0]) #set the yaw, pitch and roll to zero Code:
yPos = object.getPosition()[1] #y position of object xPos = object.getPosition()[0] #x position of object grabLink.clampPosY([yPos,yPos],1,viz.LINK_FULL_OP) #clamp item's vertical motion grabLink.clampPosX([xPos,xPos],1,viz.LINK_FULL_OP) #clamp item's lateral motion grabLink.clampPosZ([None,zBound],1,viz.LINK_FULL_OP) #clamp item's forward motion Ok, so all that is working well and good. But now I need to 'offset' the position of the object vs. the hand with a set of offsets Code:
rotationOffsets = [x,y,z] |
#2
|
|||
|
|||
I think you're looking for something like this:
Code:
positionOffsets = [x,y,z] rotationOffsets = [yaw,pitch,roll] grabLink = viz.link(hand,object,1) grabLink.preTrans(positionOffsets) grabLink.preEuler(rotationOffsets) |
Tags |
grab, hand, link, offset |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Link only one Axis | Andy | Vizard | 7 | 06-18-2013 03:30 AM |
Custom Joystick Rotation | mhead10 | Vizard | 9 | 11-26-2012 01:06 PM |
Unable to perform 360 rotation using vizact.spinto | vijaykiran | Vizard | 2 | 09-29-2009 09:39 AM |
Offset Problem | Elittdogg | Vizard | 1 | 09-15-2009 07:28 AM |
intersense orientation | jargon | Vizard | 2 | 05-14-2005 05:55 PM |