A question regarding joint orientation
When I look at the joints of a Genesis 3 figure (e.g. lThighBend), it's initial state is defined by a
- Center Point
- End Point
- Orientation
- Rotation Order
I understand that Center/End Point are defined in global X/Y/Z values. The rotation order defines, how the joint is rotated. If I have a rotation of the lThighBend, it starts with the Y (Twist) Rotation, followed by Z (Side-Side) and the X (Bend) rotation.
The thing I wonder about is the Orientation. I assume these are angles in degree. Does it mean that the initial state was made by rotating the joint (aligned with the world Y-axis) first approx. 4.95 degrees around the Y-axis, then 1.92 around the Z-axis and finally 0.65 around the X-axis?
Unfortunately the FBX importer of Cinema 4D ignores the pre-rotation values and so I have to set them manually. I just wonder, if i'm on the right track with the assumtion above.
Any idea?
Comments
Orientation is defined by the difference between the Center Point and End Point when taking the Rotation Order into account.
Or to say it in a simpler way:
If you set the Center and End point, the Orientation will tell you how much your bone is offset compared to a straight line.
Let's say you pick YZX as the Rotation Order. The program will consider a perfect straight line upwards. If your bone is not a perfect straight line upwards, it will tell you in Orientation how much it deviates from that perfect, straight line.
So yes - the Orientation is in Degrees.
Swapping Rotation Order will change the Orientation though.
Does this confusing answer somehow help you?
Hi, thanks! Let me rephrase that. I create a vector between Center and End Point. Then I rotate that Vector around the Y axis, Z axis and last around the X axis. Are the rotation axis the local axis of the joint or the gloabl axis?
...or...
The joint is oriented according to the global system. The joint axis is aligned with the world Y axis. Then the rotations are made according to the local joint system. So when you rotate around the Y axis, the Z and X axis are rotated as well.So the next rotation (Z) will be around the rotated Z axis. In this case the orientation would be independent of the End Point position.
When you use the Joint Editor tool, you can Create new bones.These bones are represented visually as sort of "arrows" pointing from the Center Point to the End Point.
The Center Point is always the BEGINING of the bone. It's the point where the movement ORIGINATES FROM.
The End Point however is used to position the point towards a specific point. If you use "Align Bone", DAZ Studio will position the bone so it is aligned from the Center to the End Point.
HOWEVER - you can use Orientation to rotate the bone. That way - it does not have to point towards the End Point. It's an additional tool.
Using "Align Bone" will set the Orientation so it matches towards the End Point.
Now - Rotation Order however will decide how the Global Axis is treated for the bone. If you use XYZ, the Orientation angles will match the scene. If you choose YZX, it will swap the axis accordingly and the "orientation of the bone" will change, but the Center and End Points will stay the same. So you can "Align Bone" to fix the orientation if you positioned the End Point correctly.
Thanks, I will do some tests in order to understand this better. I expected that the joint would always be oriented from the center to the end point, but obviously this is not the case if the orientation of the joint tool is used.Thanks again for your help.
OK, understood.
I made a lot of tests and seem to grasp now how this works. Still there is one issue that confuses me.
I create a joint, use the rotation order YZX and I set my Center Point to 0/0/0. The End Point goes to 50/50/50. Then I align the joint and get an orientation value in degrees of
Rx = 36.2060203552246, Ry = 12.2000026702881 and Rz = -36.2060203552246
These Orientation values are confusing. I expected that they follow the rotation order somehow, but then Ry should be 45°. Can anyone tell me how this is implemented?
I think you are good explorer how joint editor "orientaiton" work.
One thing I can confrim, when orientate in joint editor to set up, it not corresopond Eular rotation cordinate way. but Keep one rule about all Axis order. (XYZ ZYX, YXZ etc,,)
X orientation = rotate along to current local X axis (Bone rotate the red plane face direction)
Then, if primary (frist) axis = X, the bone can roll, keep same position. if primary axis = y or z, bone rotate on another current axis plane. (then set x=180, the node turn opositte side)
Y orientation = I can not detect what axis actually used ,then usually it difficult to controll as I planed.
Z orientation = rotate along to global Y axis.
As you know, when we pose bone, Eular rotation order is important. but about Joint editor, set up orientation, it not keep same axis order rule to rotate (orientate). And if you use Aling node, it can easy corrupt your decided orientation. after that you can not roll keep same position. without the bone rotate diferent direction.
Then I have requested daz to improve joint editor,
1. "roll" about all Axis order. at current it not work.
2 "Allign End point" to the current bone (orientation)
3. may better keep same rule when we roate joint with parameter , correspond to roattion order. (Eular) about Orientation for node set-up.
Thanks for your information. When I export Genesis 3 I get Rotation Order per joint and the PreRotation of the joint. This PreRotation is equal to the Orientation in the joint editor.
What I got so far...
+ If I set the orientation order to XYZ or XZY, the joint is aligned to the x-axis. The joint Orientation is relative to the x-axis, but there is no difference between XYZ or XZY.
I didn't expect this from a standard Euler rotation.
+ With YXZ and YZX the joint is aligned to the y-axis and in the remaining two cases with the z-axis.
The Orientation is an initial orientation of the joint's axis system. All rotations, like Twist, Bend and Side-Side are calculated from this intial orientation in Orientation Order. The initial Orientation of the joint is not. So I wonder what these angles in the joint Orientation field mean. Someone at Daz should know how they implemented it.
I also wonder, if the Blender plugin somehow takes care about it.
At start point,all bones will be generated along to gloval axis(1st rotation axis we choose) in joint editor, or in figure set up tools. then bone will be orientated by those three axis orientation with one rule, ( not same as Eular rotation, when we pose rig) to set up rig. After Memorize selected Nodes rigging, current node orientations are set as default rig orientation for zero pose.
To generate rigs (for zero pose)in another aprication, those three orientation value ( for each X, Y, Z axis )need to be recorded in exported format too. But after all, how aprication use those orientation values (which recorded in exported format from daz studio) should be different about each plug-in I believe.
Eg Iclone use FBX, to generate rig exported from daz, but I do not think it auto-circulate those orientation value (discribed by DAZ way) as same as daz studio. At least we need rig-template, which re-adjust roll and bone positon to set-up for iclone.
DAZ importer (Thomas Lason) read scene.duf and dsf to generate rigs for blender. when I request to improve facial eyelids nodes and controller,, I needed to show difference, how orientation (set-up) work with pose (rotation) in daz studio, then thomas improved drivers . But Blender only need, to know Actuall node center and end point, and one "roll value" with 12 Eular rotation order. (include minus), But I still do not understand detail, how Thomas generate rigs from dsf for Blender and set-up roll in python codes with those orientation values. I just see, it work well.
Then I think, if you use Cinama 4D, anyway try to import rig with format which you use . then compare them with zero pose in daz studio, with joint editor. even though we can see, orientation value as FBX code, it may not hlep to know, Cinema4D importer how use those values. or I may ask Cinema 4d supprot, then show exported FBX, and ask them,how Cinema 4d generate rigs from three orientation values discribed in FBX
Well, Cinema 4D imports fine via FBX, but the joints are simply aligned to the y-axis, as the Orientation of the joints is ignored. It seems that the Cinema 4D importer does not understand the PreRotation in the FBX. I can set this manually, but for this I need to know the direction of the joint, which is defined by the angle of the Orientation.
The End Point often is not on the axis of the joint (e.g. lThighBend). So the End Point doesn't help.
I know the Center Point of a joint, I know the angles of the Orientation, but how do I get a second point on the joint axis. The End Point is often not on this axis!
I'd like to know this one rule!
center point (x0,y0,z0)= Bone pivot point in gloval cordinate.
end point (x1,y1,z1) = use to ciculate bone length (scholar of vector) with center point ,and decide which direction bone point out (plus or minus of primal axis)
rotaion order (1st, 2nd, 3rd) = for pose, Eular rotation. And DS generate bone along to the 1st axis.
As I said, I do not know how y orientation will be circulated after change other orientation (x,z), but at least, if I orientate Y first, without rotate another 2 orientation, it orientate bone along to the gloval axis (because, when generate bone, it along to each Axis).
then First orientate Y, Second X (always keep local cordinate rotation I believe,), next Z (keep gloval cordinate rotation) to decide bone orientation. or I can rotate Second Z (gloval cordinate), next X (local cordinate), because, I can see, X(local) as red plane, and Z orientation axis (gloval), as visual in node editor. and it can be representede as formula.
then if I make importer, from those three orientaiton value, I may just keep the rule.
first generate bone , along to the primal axis in gloval, rotate Y axis with Y orinetation value, next rotate X rocal with X orientaiton value, finally rotate Z with Z orientation value.
As you know, end point only change bone length, then when I hope to clean visual, I need to move the end point to the Bone tips with Bone Ghosting. But Once bone orientated from pivot point, with length , it make Vector. then end point , (which attach actual bone end tips) can be circulated, by formula. in all aprciation. (though daz studio, do not offer it)
Thanks for the information. I did the following. I made a cube (100x100x100) with a joint. I set the center of the joint to 0/0/0 and set the endpoint to different values. Each time I aligned the joint and noted the orientation values.
For lines 1 and 2, I get the following values as shown in the table.
Rx, Ry, Rz are the orientation values.
I got the angles in the FBX, but how do I get a point on the axis?
If 3 orientation values are already discribed in exproted FBX as same as in daz studio value, it means you get direction of the Unit bone (size = 1) start from center point (0,0,0). though I can not offer matrix formula, how to convert local orientaiton X values, to gloval , it seems not difficult by matrix . then you can generate "bone" with the direction (with keep same roll value) with Unit1 size. in your aprication as same as daz studio.
Then if the end point is already attached bone (node) ( you used aling node) in daz studio, you can use the current End point value. to decide Point location.
if the node is not attached by end point ( you use orientation, not aling node), you can circulate the scholar value from End points (X Y Z) and center point(0, 0, 0) the node lenghth should be (x^2 + Y^2 + Z^2) ^1/2, then you only need mulitple it to Unit size bone end points. just take care, primal axis value was + or minus. (it turn direciton of the node)
(most of apricaiton, Node end point should be attached node, daz only separate End point, and actuall Node tips position)
I am not animator at all, then I do not know which is good but, use One rotation order for One rig , seems make it simple.
eg In blender, I can set primal axis as Y (for twist) about all node, with keep clean visual node arrangement.
then usually Most of rigs are set Third axis as Z, (for bend, and main rotaiton to pose) then I can easy adjust the roll. just set local Z axis to the direction to the node will bend, it is common rig about blneder (though We need not keep local rule, and I do not say it is formal)
and no need to think about, each node rotation order, when pozing, Y should be twist. Z should be main bend rotation. with local .
I can keep axis order as YXZ about all nodes of one Figure (if hope to use Eular rotation). To adjust rig, I just position end point (tip) as I need, then adjust "Roll", keep same direction. it is all for set up rig. but about daz studio, use different rotation order, along to world axis (relatively) is complex. and "set the End point + aling node" is not useful, when we set roll correctly. there is no real visulal guide to roll correctly., or change node direction easy which I am not expected, when adjust bone roll (twist orientation)
This sounds correct,but..
when I take the highlighted value I get a length of 150. So if I use a vector of 0/150/0 (aligned with the y-axis) and rotate this vector with the angles Rx, Ry and Rz, I should get a vector 100/100/0. As the FBX does not export the End Point, I need to rely on the rotation values.
Assuming a rotation order YXZ and a matrix calculation according to this formula
where c is the cosinus and s is the sinus. When I take 0/1/0 as vector aligned with the y-axis and calculate the new Y-value, I get in Excel
COS(Rx)*COS(Rz)*150 = 104.52488533131
But the value should be 100.0000. So this isn't an matrix rotation.
>>when I take the highlighted value I get a length of 150
it should be.
>>So if I use a vector of 0/150/0 (aligned with the y-axis) and rotate this vector with the angles Rx, Ry and Rz, I should get a vector 100/100/0.
it already show different lenghth . the vector (which you discirbed from three end points) are 141.421356237 length. what assmption you used ?
>>Assuming a rotation order YXZ and a matrix calculation according to this formula.
I do not check your matrix, but if it actually orientate Y, (as gloval first), then orientate X (as local next), then orienatate Z as gloval, should show same vector.
Then, those orientation values may need to be circulated from the bone which was gnerated. you can not assume rotation order.
because it decide which gloval asxis bone along to. then orientate by X,Y,Z values.
when you generate the bone, or node to your test, which rotaition order you used the node? did you actually use "rotation order YXZ" about the bone?
I can not check your formula, but I can simply generate bone and rotate it with my assamption, as same as daz studio (in joint editor)
see, I set bone with size 1.5 along to z axis first, (0, 0, 150) ( I need to change cordinate for blender, Z up, -Y)
then rotate by global Z axis first , use your excel. Ry 7.662,
next rotate by local X axis , use your excel value, Rx 19.6538 (blender is clever enogh to rotate with rocal axis presisely)
then finally rotate by global.Y axis (apply minus because blender Y face back) Rz 42.273
I can clear see, the end point of bone, locate ( 1, 1, 0.5)
then I think my assamption is right about each orientation and which axis is used for.
Sorry for the confusion, I've been in a hurry, when I wrote this.
So the inital joint is aligned to the y-axis and the center point is 0/0/0. Now I set the endpoint to 100/100/50. The length of the joint (from center to end point) is thus 150. The x-length of the joint is 100, the y-length of the joint is 100 and the z-length is 50.
The rotation matrix above simply states that you have to calculate the following in order to rotate the joint 0/150/0 (aligned to y-axis) with the rotation order YXZ. This is a joint with a length of 150 aligned to the y-axis.
y-length of the rotated joint = 0 * Cx * Sz + 150* Cx * Cz - 0 * Sx = 104.52488533131. This is not the expected 100, which proves that the joint orientation does not follow the rotation order.
When generating the bone, I used the orientation order YXZ. Interestingly it doesn't matter, if I use YXZ or YZX. The values for orientation are the same, which should not be the case, if a rotation order is used. The orientation is symmetrical and this should also not be the case.
Sorry, but I do not think your formula is right. because I can manually do samethings (generate bone and orientate (rotate) ,then it show me expected value .
that means, your formula not orientate node, or vector, as I dsicribed way. I said, "the joint orientation does not follow the rotation order."when I frist reply for you.
One thing I can confrim, when orientate in joint editor to set up, it not corresopond Eular rotation cordinate way. but Keep one rule about all Axis order. (XYZ ZYX, YXZ etc,,)
then I said how to orientate alrady. if you chang it as formula matrix, you need to keep what I said already with the order.
OK, I have to look at that. When I work according to the standard Euler rotation (https://en.wikipedia.org/wiki/Euler_angles, in the second part of the page), I get a difference. I made a short animation (you have to unpack the ZIP and play the mp4). You see how the expected orientation and the calculated orientation differs from a certain point on.
I have to check Blender, how they calculate it.
Thanks for your inspiration.
Thanks again, I have to think about what you said. I'm quite sure that the Euler matrix doesn't apply here. I have to understand and follow up what you said. It seems you are on the right track.
If it is standard Eular rotation way, it never work. so that I said, daz orientation in joint eidtor is unique for me.
I know how standard Eular rotation work . it never means I rotate bone in blender, with standard Eular rotation to show same orientation.
I discirbe once more , please just try same things but not formula, but manually in your aprication with consider, global axis of your apricaiton. (eg Y up or Z front etc,, if it is differ from daz studio)
step1. rotate as global Y with the "orientation Y value" (of daz studio cordinate)
step2. rotate as local X (current node local, after you rotate 1, it is not same axis as Eular second rotation) with the orientation "X value "(of daz sutdio cordinate)
step3 rotate as global Z (sorry miss typed) with the orietntation Z value. (of daz studio cordinate)
then the order, and each axis I used, not change with rotation order of Eular rotaion you used.
just keep same rule to rotate , which I dscirbed .
=====
then thanks you. because I could think more from your question. What I could not clear confrim , about joint editor orientation. Now I feel my assamption was right, and I feel I need to learn math again to udnerstand matrix.
actually your question is what I give up before. (because DAZ do not offer such document for me)
Hi, I rethink,, after all, ds Joint editor orientaiton value means, XYZ Eular rotation, about all node. or, I can say,
1. orientate X, with Global X Axis, >> 2. orientate y, with Global Y Axis, >> 3 orientate z, with Global Z Axis ,
( need to keep this order, X>Y>Z, when orientate with gloval axis) from generated node position which along to wolrd axis.
then If you use XYZ Eular rotation matrix . with each x y z orientation value , it will geneate node as same as ds ioint editor, I believe. otehr orientation order matrix not work.
So you say that the rotation is always around the global axis in the rotation order. This could make sense, but I have to check it.
If I have a joint/bone in y-direction and first rotate it along the y-axis, I rotate it next around the x-axis and last around the z-axis. Hmm, interesting.
I said,, you need to keep the, one X-Y-Z rotation order. when apply those orientation value.
there is only one rule about how joint editor orientation work. but we can choose the rule expression to generate same node.
1. I said, 1st rotate Y as gloval (Y orientation value ), 2nd, rotate X as local axis (X orientation value), 3rd, Z as gloval. (it is what I said before).
2. You can 1st rotate X as gloval. (X orientation value)> 2nd rotate Y as gloval,> then 3rd rotate Z as gloval with Z orientaiton value.
(it is because, when generate node, all orientation = zero, and bone along to gloval axis in daz studio. local axis is same as gloval when generate node)
these 2 ways generate same node (with same vector, same length, and have same local axis) , but you need to keep the order.
then I can say, after all those 2 ways show same behavor as XYZ Eular rotation, with each orientation value.
I think (almost can confirm) ds always apply XYZ Eular rotation with each orietaniton value, (X>Y>Z) then decide generated node orientation. (local axis) for zero pose.
On the other hand, in pose, rotation order YZX or YXZ or XYZ show clear difference (belong to Eular rotation with the node rotation order, which we choosed when generate the node)
Hi there,
I can confirm that the rotation order for the joint's initial orientation is XYZ. This is totally independent of the rotation order and this was very confusing. You were completely right and solved a huge issue for me. Thanks, Thanks, Thanks a lot!!!
The second line leads to the correct values and I'm able now to do a quaternion conversion for the joint. This is perfect!
Yes DAZ joint editor is real complex and confusing for me . And I really thank you to ask clear rule.
Without finding clear rule (discribed and represented), I adjust rig approximately only. ( align node can not set precise roll value, I do not know why we need to set end point if there is case, it not attach bone. I really hope, daz improve joint editor tool more flexible.
1. scale node length easy as parameter from generate 1 unit node.
2. offer way to "roll bone for node primal axis" (twist in pose), without change 2nd and 3rd orientation.
3 with above two , always attach end point to the node. (why there is case, the node not attach end points? )
4 not flip bone, without we flip orienttaion. (it is real confusing too)