![]() |
|
#1
|
|||
|
|||
Thank you so much.
|
#2
|
|||
|
|||
Sorry, two problems when I use your code.
1. I guess shoulderBone comes from getbone('skel_ShoulderL'). Then where is elbowBone from? I don't see a elbow bone in the skeleton. 2. If shoulderBone and elbowBone are from getbone(), maybe because my Vizard is only 2.17a, it doesn't support <bone>.getPosition command. Is there any substitute? More question about version 2.17a: It seems <bone>.setEuler doesn't work in this version too. Any substitute for setting the rotation of the bone? Thanks, ruddle |
#3
|
|||
|
|||
Hi,
Sorry, the code I posted was for Vizard 3.0. In 2.17, I believe the syntax for getting a bone position/rotation is the following: Code:
pos = bone.get(viz.POSITION) euler = bone.get(viz.EULER) Code:
skel_ArmLU skel_ArmLL skel_HandL |
#4
|
|||
|
|||
This time it works. Thank you.
The results are: The distance between skel_ShoulderL and skel_ArmLU is 0.144409524884. The distance between skel__ArmLU and skel_ArmLL is 0.159618362784. The distance between skel__ArmLL and skel_HandL is 0.00597032904628. So I guess the length of upper arm is 0.14, and the lower arm is 0.15. Right? |
#5
|
|||
|
|||
Hi,
Actually that's incorrect. You need to get the absolute world position of the bone: Code:
bone.get(viz.POSITION,viz.ABSOLUTE_WORLD) Code:
skel_ArmLU -> skel_ArmLL = 0.284790087668 skel_ArmLL -> skel_HandL = 0.290760380194 |
#6
|
|||
|
|||
Many thanks. Two more questions about viz.ABSOLUTE_WORLD:
1. Given the angle between shoulder and upper arms, and the angle between upper and lower arms, Can I set the arm like this: LowArmBone.rotate(0,-90,0) UpArmBone.rotate(0,-60,30) What do I need to use: viz.ABSOLUTE_WORLD or viz.ABSOLUTE_LOCAL? 2. Given the position of hand, Can I set the hand like this: HandBone.translate(x,y,z,viz.ABSOLUTE_WORLD) Why only viz.ABSOLUTE_LOCAL works? ruddle |
#7
|
|||
|
|||
Hi,
viz.ABSOLUTE_LOCAL will perform the rotation in the bones local coordinate system. viz.ABSOLUTE_WORLD will perform the rotation in the world coordinate system. There were some bugs with performing manual bone rotations in Vizard 2.x. I would recommend upgrading to Vizard 3.0 if possible. Translating the hand with viz.ABSOLUTE_WORLD should work. Are you locking the bone before performing the translation? |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|