DEMO SPLICE : Bendy arm
Hello folks! As promised here a follow up of my development in Fabric Splice !! Today we are talking about bendy arms! Ever heard of it? In the computer graphic industry when you talk about bendy arms you mean a cartoony setup that allows you to create arcs in body limbs like it was a tail rather that just simple sharp bends in knees and elbows for example. Now to achieve that result require to resolve of a couple of problems :
- How to bend the arm? Means how to get an arc?
- How to orient the bones along the arc?
- What about distributed twisting?
The node I wrote in splice is going to adress exactly all those problems.
Before get started with explanations let s see what we got here. This is a picture of the actual node , with opengl debug on, the node get as input an array of matrices, in this case 3 , shoulder , mid , elbow and shoots out the matrix array of the computed bendy bones. The resulting dots are the position computed and the lines is the Y axis of the resulting rotation matrix
How to bend the arm? Means how to get an arc?
In order to have the bones deforming into a nice arc I used the input matrices to interpolate a nurbs curve ( Yeah now you see why I wrote a nurbs curve huh?) . Once I get a nurbs computed in the node I can then evalute points along the curve, done we got our bendy positions.
How to orient the bone along the arc? & What about distributed twisting ?
I am actually gonna answer this two questions all at once because solving one means solving the other. In order to compute the orientation along the curve first of all I need to be able to query a tangent to the curve and an up up vector, once I takled this I can actually generate an orientation matrix , but the math I did is a bit different , since I had to re-adapt the algorithm from maya API to splice API. First thing I did was extracting the twist , this is quite tricky since you need to be able to re-alling quaternions without losing the twist , and I actualyl improved my old algorithm and found a better axis for performing the align, with a combination and the twist and a tangent vector I am able to compute the final quaternion rotation that allows me to get my object aligned to the tangnet on the curve and twisted properly. Actually splice allows you to extract a matrix from a quaternion and a point which saved me a bit of math. Of course the whole thing is running on parallel thanks to PEX ( where possible). Enough talk here is the demo!
That s it folks! As usual If you like it please follow my channel and share it around. You can also stay up to date with all my videos by subscribing to the newsletter at : marcogiordanotd.com/newsletter.php