![]() |
#8
|
|||
|
|||
Jeff,
I'm getting closer, but still not quite there. I can get the centers assigned correctly, but my simulation displays my tool in what looks like 3 different places at the same time still (attached). I think the centers, eulers, and positions are not getting assigned quite quickly enough, therefore, there's a small lag between each. Is there a better way to do what I'm trying to accomplish (get the shaft to rotate/position with three separate centers in one visual piece)? Altering the subtasks with yields (setCenters) hasn't changed anything. Thanks again for your help! Updated Code: Code:
def Kinematics_1(): scale = 40 #degrees (360/9) trans_scale = 1 #translation pot (pot #1) x = 180 shaft.center(0,0,1.738) #POT 0- BASE ROTATIONS# yield shaft.setEuler(180+scale*pdata[0],0,0) #POT 1- TRANSLATION# yield shaft.setPosition(0,0,pdata[1]*trans_scale-3, viz.ABS_PARENT) #pot 2: grasper open/clock if pdata[2]*scale > x: #graspers are not touching #print 'graspers NOT touching' babcock_1.setEuler(x-pdata[2]*scale,0,0,viz.ABS_PARENT) babcock_2.setEuler(-x+pdata[2]*scale,0,180,viz.ABS_PARENT) else: #graspers are touching #print 'graspers touching' babcock_1.setEuler(x/scale,0,0,viz.ABS_PARENT) babcock_2.setEuler((x/scale),0,180,viz.ABS_PARENT) #POT 3: JOYSTICK TIP ROTATION #POT 4: FIRST U-JOINT ROTATION yield shaft.setEuler(180+scale*pdata[0],(pdata[4]*scale)+180,-(pdata[3]*scale)+90) #def Kinematics_2(): #alter center point of rotation shaft.setCenter(0,-1.6125,1.738) #POT 5- 1st U-Joint, 2nd Rotation #POT 6- 2nd U-Joing, 1st Rotation yield shaft.setEuler(0,(-pdata[5]*scale)-180,pdata[6]*scale) #def Kinematics_3(): scale = 40 #alter center point of rotation shaft.setCenter(0,-3.227,1.738) yield shaft.setEuler(0,0,pdata[7]*scale+40) def Main_Loop(): while True: yield Kinematics_1() viztask.schedule(Main_Loop()) |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
joystick position | nmohandes | Vizard | 2 | 01-16-2012 10:03 AM |
writing joystick position to a data file | Saz | Vizard | 3 | 12-17-2008 05:18 AM |
Joystick Navigation | Vinicius Lima | Vizard | 7 | 10-23-2007 10:42 AM |
Facetracking and Immersion Joystick | Vygreif | Vizard | 1 | 01-25-2006 10:56 AM |
animating custom faces: in search of "open_mouth" morphs | vr_boyko | Vizard | 1 | 09-16-2004 10:30 AM |