|
#1
|
|||
|
|||
Hi,
Even though you didn't explicitly say anything about it, I'm assuming you are trying to apply an offset rotation to the racket? There are many ways to go about this. 1) As you already mentioned, you could rotate the model in 3ds max. This would probably be the easiest solution. 2) Manually apply the rotation in a timer and apply the offset with it. It seems like this is what you are already trying to do. Try the following code instead: Code:
def mytimer(num): ori = racketOri.get() racket.rotate(ori[3],ori[4],ori[5]) racket.rotate(offset[0],offset[1],offset[2],viz.RELATIVE_LOCAL) 3) You could use a transform hierarchy to offset the racket automatically. Here is some sample code: Code:
racket = viz.add(viz.GROUP) racketModel = racket.add('racket3.wrl') racketModel.rotate(offset[0],offset[1],offset[2]) racket.link(racketOri) 4) Reset the intersense in your offset rotation. Hold the physical racket in the neutral position and apply a reset command to the racketOri. After this point the intersense plugin will automatically apply an offset to the rotation. I noticed that you are using a different intersense plugin named intersense2.dls. If it is an older version of the plugin, then this method might not work. Anyway, to use this method you would use the following code: Code:
racketOri = viz.add('intersense.dls') racketOri.command(8) #Tell the intersense to use quaternion rotations instead of eulers racketOri.command(9) #Tell the intersense to apply offset rotation Code:
racketOri.reset() |
|
|