DeFi
09-09-2007, 03:54 PM
Hi,
today I thought again about animating a snake and a part of the setup I came up with might be worth sharing.
I came to the conclusion that it would be very nice to have splines with integrated normals making it possible to have smooth control over the direction of the spline ik solution in world space. Unfortunately 3dsmax doesn't have this feature(as far as I know) and so I thought about a workaround.
First I constructed a kind of stabilized spline-IK. To do this, I started with a bone chain with standard stretchy-bone setup including a linked second row of point-helpers as look-at targets to be able to control the direction of the bones. Then I created a second bone chain with the same number of bones, put spline-IK on it and position constrained the point-helpers of the stretchy chain to the positions of the spline-IK chain bones. The result was a spline-IK chain with direct control over the bone directions(by modifying the positions of the look-at point helpers).
Now my idea was, to control the point helpers, that control the direction of the bones with a second spline-IK setup on another bone chain. So I made a copy of the first simple spline-IK chain and moved it somewhat away from the first one. Then I position constrained the look-at point helpers to the positions of the bones on this second chain. The result was the possibility to control the direction of the bones by adjusting the second spline in relation to the first one.
But I wanted to improve the usability and then I had this crazy idea to make use of the loft- modifier. Loft objects somehow allow controlling a spline-normal with a twist graph. So I loftet a small straight spline that was as long as the distance between the two control-splines with the first control spline as path. Then I skin-wrapped both control splines to the new loft object. (of course the two control-splines have to be subdivided to rather short segments). The result is, that the second control spline now can be moved in a fixed distance from the motion path and the rotation can be controlled in world space by using the twist graph.
Now the percent values of the path constraints(located on the first bones in the spline-IK bone chains) can be animates synchronously to drive a snake or an rollercoaster on a spline path with easy control over the direction by modifying the twist graph of an loft object. By modifying the path of the loft object(which can have much much less points than the two control splines) the trail can be put in proper position and even adding bezier handles for exact curve control doesn't break the setup.
Much stuff for reading, here are some images:
The two control chains:
http://www.defi1.de/splineIK/control_chains.jpg
The loft object:
http://www.defi1.de/splineIK/control_loft.jpg
The target bone chain:
http://www.defi1.de/splineIK/target_chain.jpg
Two test animations:
Animation (http://www.defi1.de/splineIK/anim.avi)
Animation2 (http://www.defi1.de/splineIK/anim2.avi)
I hope you find this somehow useful. :)
Greetings
DeFi
today I thought again about animating a snake and a part of the setup I came up with might be worth sharing.
I came to the conclusion that it would be very nice to have splines with integrated normals making it possible to have smooth control over the direction of the spline ik solution in world space. Unfortunately 3dsmax doesn't have this feature(as far as I know) and so I thought about a workaround.
First I constructed a kind of stabilized spline-IK. To do this, I started with a bone chain with standard stretchy-bone setup including a linked second row of point-helpers as look-at targets to be able to control the direction of the bones. Then I created a second bone chain with the same number of bones, put spline-IK on it and position constrained the point-helpers of the stretchy chain to the positions of the spline-IK chain bones. The result was a spline-IK chain with direct control over the bone directions(by modifying the positions of the look-at point helpers).
Now my idea was, to control the point helpers, that control the direction of the bones with a second spline-IK setup on another bone chain. So I made a copy of the first simple spline-IK chain and moved it somewhat away from the first one. Then I position constrained the look-at point helpers to the positions of the bones on this second chain. The result was the possibility to control the direction of the bones by adjusting the second spline in relation to the first one.
But I wanted to improve the usability and then I had this crazy idea to make use of the loft- modifier. Loft objects somehow allow controlling a spline-normal with a twist graph. So I loftet a small straight spline that was as long as the distance between the two control-splines with the first control spline as path. Then I skin-wrapped both control splines to the new loft object. (of course the two control-splines have to be subdivided to rather short segments). The result is, that the second control spline now can be moved in a fixed distance from the motion path and the rotation can be controlled in world space by using the twist graph.
Now the percent values of the path constraints(located on the first bones in the spline-IK bone chains) can be animates synchronously to drive a snake or an rollercoaster on a spline path with easy control over the direction by modifying the twist graph of an loft object. By modifying the path of the loft object(which can have much much less points than the two control splines) the trail can be put in proper position and even adding bezier handles for exact curve control doesn't break the setup.
Much stuff for reading, here are some images:
The two control chains:
http://www.defi1.de/splineIK/control_chains.jpg
The loft object:
http://www.defi1.de/splineIK/control_loft.jpg
The target bone chain:
http://www.defi1.de/splineIK/target_chain.jpg
Two test animations:
Animation (http://www.defi1.de/splineIK/anim.avi)
Animation2 (http://www.defi1.de/splineIK/anim2.avi)
I hope you find this somehow useful. :)
Greetings
DeFi
