#1
|
|||
|
|||
Custom Joystick Rotation
Hello,
I'm trying to find the best way to simulate my grasper (like a tweezer- referred to as "babcock" in my code), which is driven by a custom joystick (I'm including an example picture (attachment # 1) of my joystick (left) and grasper (like a tweezer, on the right) for clarity). I'm trying to rotate my grasper around three different axes (Rx1, Rx2, Rx3). Therefore, I'm currently thinking the best way to accomplish this is by:
However, when I assign a new center from the original grasper origin, 1 unit in the z-direction away (to obtain Rx1), the center remains at the original origin (as seen in attachment # 3). Code:
# move babcock up and forward a bit (1.25, 2) from World Coordinate System babcock.setPosition([0,1.25, 2+ data[2]],viz.ABS_GLOBAL) # data[2] = TRANSLATION potentiometer babcock_axes = vizshape.addAxes(parent = babcock, pos=[0,0,0],scale=[.05,.05,.05]) X2 = viz.addText3D('X2',pos=[0.1,0,0],color=viz.RED,scale=[0.05,0.05,0.05],parent=babcock) Y2 = viz.addText3D('Y2',pos=[0,0.1,0],color=viz.GREEN,scale=[0.05,0.05,0.05],align=viz.ALIGN_CENTER_BASE,parent=babcock) Z2 = viz.addText3D('Z2',pos=[0,0,0.1],color=viz.BLUE,scale=[0.05,0.05,0.05],align=viz.ALIGN_CENTER_BASE,parent=babcock) # center of rotation is 3.5 from original (LCS) babcock.center(0, 0, 1) #change center of rotation to Z0 + 1 (DOESN'T WORK?) babcock_axes2 = vizshape.addAxes(parent = babcock, pos=[0,0,0], scale = [.05,.05,.05]) #CHANGE local axis to babcock (0,0,1) for Rx1 Rotation X3 = viz.addText3D('X3',pos=[0.1,0,0],color=viz.RED,scale=[0.1,0.1,0.1],parent=babcock) Y3 = viz.addText3D('Y3',pos=[0,0.1,0],color=viz.GREEN,scale=[0.1,0.1,0.1],align=viz.ALIGN_CENTER_BASE,parent=babcock) Z3 = viz.addText3D('Z3',pos=[0,0,0.1],color=viz.BLUE,scale=[0.1,0.1,0.1],align=viz.ALIGN_CENTER_BASE,parent=babcock) # why is the new babcock.center over the previous still? attached pic # 3 Code:
babcock.addAction( vizact.spin(1,0,0,90)) #for testing purposes only Lastly, (a less important problem currently) it seems like my scaling functions are in meters, but the numbers chosen for position are in units of inches for some reason. Is this correct? For example, if I enter a unit of 1 for the new center position distance, it definitely doesn't look like 1m, rather it's more like 1 inch. (as a frame of reference, I put a 1 inch cube (second attachment) in my VR environment, and all the sizes seem correct) Thanks in advance! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
joystick position | nmohandes | Vizard | 2 | 01-16-2012 11:03 AM |
writing joystick position to a data file | Saz | Vizard | 3 | 12-17-2008 06:18 AM |
Joystick Navigation | Vinicius Lima | Vizard | 7 | 10-23-2007 11:42 AM |
Facetracking and Immersion Joystick | Vygreif | Vizard | 1 | 01-25-2006 11:56 AM |
animating custom faces: in search of "open_mouth" morphs | vr_boyko | Vizard | 1 | 09-16-2004 11:30 AM |