The springs are deformed using a blendshape - my first instinct was to use the helix's creation history height field to drive the stretch. Applying this I soon discovered the deformation occurs from the centre and expands out in the y axis, which is unrealistic. A car suspension springs deformation works from the top down.
To overcome this I used a MEL script called "spiral" which creates a cv curve with the height radius and coil number specified by the user.
The command is as follows:
spiral (Height, Radius, Coils)
The parameters should be identical to the poly helix's dimension's so the curve runs through it's centre you usually have to scale it in x -1 and rotate it in y by 180 degrees to match it up). Once the curve is created, attach it to the poly helix via a wire deformer, then add a joint chain which runs through the centre of the spiral (give it a generous amount).
Skin the joint chain to the spiral curve and scale each joint in x (excluding the end joint unless its oriented correctly). You should be getting a nice even deformation down the poly helix, with no flattening as it stretches.
Pitfalls
So up intil now, things have appeared pretty straight forward, but there are a couple of things to look out for when building this set-up.
flattening out:
Image left is the initial state of the spring - it has a spiral curve driving it which in turn is driven by a joint chain. So far so good. Next step is to test it out by scaling the joints (minus the last one) in x to stretch it out.
When scaled in x it is painfully obvious the deformation is wrong - the spring flattens out at the bottom.This occurred because I initially build the poly helix with its coils too tight together, which means the wire deformer's coils are affecting more than one coil each. So this means going back, rebuilding the spring with more generously spacd coils and repeating the process - not the end of the world, but something to bare in mind from the start.
<< 01 02 03 04 05 06 07 08 09 10 >>
No comments:
Post a Comment