In edit mode I set bone position(head and tail) and after that set roll to zero. Now I need get coordinates X axis local bone`s system (in global system), where it can find or how to calculate?
2 Answers
-
$\begingroup$ I see it quite well, but I need numerical this vector. I don`t understand how it calculated, of course, there are many orientation around Y axis for local system, one parameter is free, but only one state is chosen for initial. Why exactly this, and how i can get it. $\endgroup$ Commented Jan 25 at 8:38
-
$\begingroup$ to understand the question. The vector Y is defined by points Head and Tail, the third vector is uniquely defined as the vector product of the first two, there is an orthogonality condition to determine the second vector, but it is not enough, some other condition is needed to determine the second vector. So what condition is used? $\endgroup$ Commented Jan 25 at 9:50
From testing, where any deviations are small enough to be explainable by precision issues:
Given head position and tail position in armature space, and bone roll, you can calculate the armature-space +X axis of the bone from two axis-angle rotations:
Determine the cross product of the bone vector (tail-head) and 0,1,0. Rotate the X axis (1,0,0) in this cross product by the difference in angles between bone vector and 0,1,0.
Rotate this new vector around the bone vector by the amount of roll.
In the case of a bone pointing 0,1,0 or 0,-1,0, you can't do the first step (cross product is zero vector.) Instead, go straight to 2, using a calculated vector of 1,0,0 or -1,0,0 respectively.
-
$\begingroup$ I know how to set the bones to a position with exactly known me values of the vectors of the basis of the local system, but this is not the right way. I can do this for myself, but it will mean that every time before using the procedure will need to make such align for each bone, labor-intensive and incomprehensible for evryone. It`s very wrong resolving. Although the question should be quite simple - to understand what condition was used to fix the free parameter. At first I thought just to position the vector X parallel to the X-Y plane, but not. $\endgroup$ Commented Jan 25 at 17:10
-
$\begingroup$ What condition is used to fix the free parameter-- the Y axis-- is that a roll of 0 is what you get when you rotate from the armature Y axis to the bone Y axis, in the cross product of both. But you're probably not asking what you want to ask. You want to know how to set the X axis to an arbitrary direction, without worrying about what roll value to use? Use "recalculate roll" operation in edit mode. $\endgroup$– NathanCommented Jan 25 at 17:30
-
$\begingroup$ I don't think I understood your answer. But I watched how the roll changes in the blender when the tail position changes - i move tail only along local Y axis, so bone not must rotate. But does. $\endgroup$ Commented Jan 25 at 17:49
-
$\begingroup$ Local orientation is armature space. If you want to see tail move, without change in roll or rotation, move in normal Y axis. Movement in armature Y will change the axis of rotation beween it and 0,1,0. But I still think you should focus on the question you want to ask-- if you don't want to do math, don't ask how to calculate the bone roll; if you want to know how to get a bone's axes to point the way you want, ask how to do that instead. $\endgroup$– NathanCommented Jan 25 at 17:54
-
$\begingroup$ ok, I need some pause to analyze your answer. $\endgroup$ Commented Jan 25 at 18:00