bicep and forearm roll

Issues concerning rigging & Face Robot...
missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

bicep and forearm roll

Post by missingkey » 08 Jan 2014, 19:53

Hi There,

in the SDK there are two commands for roll divsions, MakeBicepRoll, and MakeForearmRoll.

I'm wanting to add some roll division controls to an ICE IK FK solver I put together, and was hoping somebody had some insight behind these commands.

From the Docs:
The start and end rotations are determined differently for a forearm roll and bicep roll (MakeBicepRoll). In forearm roll, the starting rotation is the forearm's rotation minus any spin, calculated using the bicep's rotation. The end rotation is the next bone's rotation (wrist) with spin. Roll division rotations are then interpolated between the start and end. In the case of bicep roll the bicep bone is used for both start and end rotations. The start rotation is the bone's rotation minus spin, the end rotation is its rotation with spin.
I'm trying to make some sense out of this, I feel really stupid though. What is spin?

I'd like to come up with the math behind this so I can set the roll divisions transforms in ice. I think I'm overcomplicating things though, can someone please help me make some sense of this.

the more I read that quote from the docs, the more i think it's worded more complicated than it really is. lol.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: bicep and forearm roll

Post by EricTRocks » 08 Jan 2014, 21:01

I believe Spin is X rotation or "roll" around the axis the bone is pointing down.

Some good info here on some approaches:
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 08 Jan 2014, 21:24

ahh yes. that's very interesting. Slightly paintful for the first few minutes or so (lol) but very useful.

I hadn't even really thought about using some ribbon/twist deformer stuff for the rolling.

this actually seems a bit easier than how I was initially approaching it, and way more functional.

Thanks!

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 08 Jan 2014, 23:02

Okay so I feel like I should be able to do in ICE what the nurbs surface is contributing - based on my current setup, and some of the vectors I have calculated for use.

I should be able to distribute however many extra transformations (rolls/divisions) down the length of the bicep vector, and rotate those vectors(X) by whatever scalar.

But I guess then Im back to where I started. lol. doh!

I guess I'm hitting my head on the bicep rotation without "spin/roll", as far as what the vector looks like compared to with spin/roll...? I suppose I should brush up my linear algebra.

This guys setup is more of less doing what I wish I could figure out. I'm almost there.

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 09 Jan 2014, 02:43

Well figuring out the transformations of the rolls divisions down the length of the bicep ending up being really easy, since I had already calculated the positions and rotations for the IK solver.

I'm now however having trouble figuring out how to roll that, or better put "un-roll" it. I have a feeling I need to use the increment rotations with 2 vectors, but I'm stuck again, lol. Any ideas?

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 09 Jan 2014, 18:01

how to rotate/spin a transformation around one of it's local axis?

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 09 Jan 2014, 19:04

Doh! I feel really dumb again. lol. I was rotating the wrong vectors, around the wrong axis. haha

This works really well now. I broke down the matrix into a 3d vector, and rotated the Y and Z vectors with an "Axis and Angle to Rotation" node with the X vector as the axis, and then rebuilt it's matrix

Now I just need to figure out how to drive the angle properly, so I don't get any strange flipping.

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 09 Jan 2014, 19:50

Well If anybody's listening, haha. I figured out how to drive the angle in order to basically unroll the divisions against the "spin" of the bicep. It's very smooth, and there's no flipping so far.

Now I'm having trouble incrementing the angle down the divisions. Anything i try, ends up with the roll divisions starting twisted.

Here's a shot of the ice nodes for one of the roll divisions, and two other screenshots of the chain at rest, and the up vector animated. All of the roll divisons are "un-rolling" 100% currently.


edit: Okay well, I get some nasty flipping when I rotate the bicep past +/- 90 in FK around the length of the chain. everything looks real nice in IK.

I feel like even with using a ribbon, you would still have to figure out how to tie the one end of the ribbon to the shoulder/root, but still have it rotate in Y & Z with the bicep, but not spin with it. The other end of the ribbon would just use the biceps spin.

So I guess the question is, what is the best way to tie whatever roll setup you use into the transformations of the bicep? does that make any sense,lol.
Attachments
IceTree_Rolldivisions.png
RollDivisions_static.png
RollDivisions_static.png (8.1 KiB) Viewed 1998 times
rollDivisions_upVector.png
rollDivisions_upVector.png (9.65 KiB) Viewed 1998 times

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: bicep and forearm roll

Post by Mathaeus » 09 Jan 2014, 21:41

missingkey wrote:how to rotate/spin a transformation around one of it's local axis?
you could compare rotations by rotating the vectors, x or y or z, then it's possible to use 'get angle between two vectors'. To line up these rotations better, in order to get "local" rotations, I think formula is get 'parent' global matrix, or rotation, multiply by inverse of 'child' global matrix, or rotation. 'Get angle between two vectors' returns the angle between 0 and 180, for 180 to 360 you'll need to compare with another, orthogonal vector ( so if first comparison uses x, second will use y or z). If another comparison returns more than 90, first is negated and 180 is added ( or something like that..).

Just in case you want to blend rotations around all three axes in easy way, you convert rotation to quaternion, do 'quaternion interpolate', convert result back to orientation.

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 09 Jan 2014, 22:08

Hi Mathaeus, thanks for replying.

I'll have to read, and re-read what your wrote a few times to grasp what your saying. it's a little over my head, but I am somewhat familar with swapping between global space and local space in ICE.

I ended up being able to simply rotate the Y and Z vectors around the X axis of the IK solution. I'm now stuck on how to drive that.

I figured out incrementing the rotation per roll divisions using an fcurve, so now I just have one scalar value that controls the twist throughout.

The problem I'm having, which seems to be quite common. is how to drive the that scalar value to get my twisting automatically.

Any rotation values used, obviously ends up with flipping. Victor Vinyals has a really nice setup for this in maya, but I'm unable to find any information about the technique. Most things talk about using extra constraints, upVectors, and helper objects, it starts to blur the technique when trying to apply it in ICE with transform matrices and vectors.

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: bicep and forearm roll

Post by Mathaeus » 09 Jan 2014, 22:54

missingkey wrote:Hi Mathaeus, thanks for replying.

I'll have to read, and re-read what your wrote a few times to grasp what your saying. it's a little over my head, but I am somewhat familar with swapping between global space and local space in ICE.

I ended up being able to simply rotate the Y and Z vectors around the X axis of the IK solution. I'm now stuck on how to drive that.

I figured out incrementing the rotation per roll divisions using an fcurve, so now I just have one scalar value that controls the twist throughout.

The problem I'm having, which seems to be quite common. is how to drive the that scalar value to get my twisting automatically.

Any rotation values used, obviously ends up with flipping. Victor Vinyals has a really nice setup for this in maya, but I'm unable to find any information about the technique. Most things talk about using extra constraints, upVectors, and helper objects, it starts to blur the technique when trying to apply it in ICE with transform matrices and vectors.
Of course, 'global' and 'local' SRT is completely relative here. Just want say how, maybe, it's easier to narrow it down to first executed rotation - that is , if you do that roll division first, then apply the parent transform after, it should not flip. In picture, I did this on point cloud ( as my ancient SI does not support ICE kine) - but I believe it's pretty explanatory. So, rotation of selected null, relative to rotation of unselected one , drives the X rotation of particles.

Image

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 09 Jan 2014, 23:12

Okay I follow that. I don't think I'm going about it as elegant as you did, but I'm more or less getting the same result.

It doesn't flip anything If I drive the rotation directly. But when I try to create the scalar that drives it from rotation values, that causes the flip. I can only assume it's because the way those euler rotation values are calculated. Does that make sense? Maybe your giving me the answer and I'm not understanding you right?
Attachments
rotateVector_RollDivisions.png

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 10 Jan 2014, 00:06

Well I've got something working using the "get angle between" node. I'm honestly still trying to understand what I did. I'm getting the values I need now to drive the rotation. however, at some points where those values should be negative, their actually positive. Since it's always gonna give me a positive number for the angle between two vectors - makes sense really, but how to get around that.


edit: Okay so I'm now getting the angle between the root vectorZ and the Bicep Bone Vectorz giving me the scalar value I need to drive the rotations of the roll divisions. I'm still having problem with always receiving +values though.


this article puts my troubles into words. Comparing the Hand heigh to the shoulder height is interesting, and just may be the condition I need. But how to account for the up vector?

http://www.fie.us/rolls-and-other-rolls/

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: bicep and forearm roll

Post by Mathaeus » 10 Jan 2014, 02:54

missingkey wrote:I'm getting the values I need now to drive the rotation. however, at some points where those values should be negative, their actually positive. Since it's always gonna give me a positive number for the angle between two vectors - makes sense really, but how to get around that.
well I think I've already answered in my first post: you need an additional, orthogonal vector ( orthogonal to first testing vector) if angle to that second vector is more than 90, then... This gives you 360 angle.

By the way, if standard Softimage kinematics is still an option, you can set the "indicator" null: parent it to object where you want to apply transform, pose constraint it to object of interest. Read and apply local transform of this "indicator" to anything you want. Just set the zero constant expression on SRT parameters, to prevent local angles to go in some insane value.

missingkey
Posts: 91
Joined: 19 Dec 2012, 18:16

Re: bicep and forearm roll

Post by missingkey » 10 Jan 2014, 18:14

ah sorry, you did answer that in your first post ;)

So right now, X is going down the bone, Y is pointed at my upvector, and Z is the cross product of the X&Y.

the root is aligned to the first bone, and I'm getting the angle between the bicep Z vector, and the root Z vector. So the condiiton would be: If angleBetween( BicepZ, RootY ) > 90, take the angleBetween( BicepZ, RootZ ), negate it, add 180. Otherwise, use the angleBetween( BicepZ, RootZ ) ?
Attachments
BicepRoll180.png
BicepRoll180_2.png

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: bicep and forearm roll

Post by Mathaeus » 10 Jan 2014, 21:01

missingkey wrote:ah sorry, you did answer that in your first post ;)

So right now, X is going down the bone, Y is pointed at my upvector, and Z is the cross product of the X&Y.

the root is aligned to the first bone, and I'm getting the angle between the bicep Z vector, and the root Z vector. So the condiiton would be: If angleBetween( BicepZ, RootY ) > 90, take the angleBetween( BicepZ, RootZ ), negate it, add 180. Otherwise, use the angleBetween( BicepZ, RootZ ) ?
Honestly I don't have these things 'engraved' in my mind. Here in pic is my helper map. This one just goes from 0 to 360.

Image

BTW I know you know , angle can be calculated directly from vector . That's a bunch of nodes in bottom group. If so, there is no chance for anything to flip. In the past, I've used similar method a lot, to get orientation of bicep, then to modulate the corrective shape keys on shoulder. (Using a bit extended trick with classic Si constraint - where null is constrained with offset of 1, to bicep bone. Having parent in place of chain root, constrained by orientation to chest bone) To get it linear from arc, it's arc tangent2 or two arc tangents for 2d, arc cosine for 1 d, or cosine or sinus for a kind of smooth step like interpolation.

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests