PDA

View Full Version : Simple question: animating a C-shaped spring


Iggy
08-07-2003, 06:52 PM
Okay, another simple one today that I just can't quite get. I have this C-shaped spring.

http://www.mechanolatry.com/images/cgtalk/C-spring.gif

I want to animate it coming under tension. This means that very simply the C will close down, like it's taking a bite. The radius will shrink and it will deform evenly. I've tried a few different things, the bend deformer and manipulating points, but I haven't had any luck yet making it look realistic. I'm sure there is a simple way to do this, but I can't figure it out! In the final version there will be objects that stay pressed up against the spring in a tangent way. Any recommendations for how to set it up so that when the spring deforms these objects move along with it?

I love Cinema 4D! The learning curve is steep, but it's so damn fun...

Shademaster
08-07-2003, 08:29 PM
Yea and while whe are at the spring debate, I am trying to get a car spring (long spiral shaped) to compress/decompress. I made an expression build suspension and I want to put a spring in one of them that gets compressed/decrompressed realistically.

Sorry for not contributing any usefull information Iggy but I thought this question might fit in. :)

JamesMK
08-07-2003, 09:01 PM
Iggy - I just gave it a shot... Grab the file and see what you can make of it. To compress the spring, just pitch-rotate the root bone....

http://w1.480.telia.com/~u48033445/c-spring.c4d

Iggy
08-07-2003, 10:07 PM
I like your solution James. It gets a little deformed when it goes to all the way closed as you can see here. Is there a way to prevent that? (I don't know anything about bones yet...) It looks really good, and is probably the direction that I need to be moving. Thanks very much for your help.

http://www.mechanolatry.com/images/cgtalk/bonebent.gif

I had a feeling that bones would do it, but I've never used them before, and was a little hesitant to start down that path. I'll fool with it and see if I can make it work a little better. I'll get to it tomorrow and post some more then.

Today is my 4th wedding anniversary! No C4D for me tonight! My mom's watching the baby and the wife and I are headed out!

Iggy

JamesMK
08-08-2003, 12:23 AM
Ah, good it could be of use. It was really quick and dirty, hence the general crappyness - and I honestly don't feel comfortable with the Cinema bones just yet either... Maybe you can refine it.

And happy anniversary! Hope you'll have a good time out.

AdamT
08-08-2003, 05:52 AM
Originally posted by Shademaster
Yea and while whe are at the spring debate, I am trying to get a car spring (long spiral shaped) to compress/decompress. I made an expression build suspension and I want to put a spring in one of them that gets compressed/decrompressed realistically.

Sorry for not contributing any usefull information Iggy but I thought this question might fit in. :)

If you are using a helix spline for the spring all you have to do is animate the height parameter.

cookepuss
08-08-2003, 07:47 AM
Not sure if it's what you wanted, but (with a helix spring) I used a combination of an animated bend deformer and animating the helix height as Adam suggested. It looks prett good. Almost like a Slinky. :)

http://www.rlsanta.com/springy.c4d
http://www.rlsanta.com/springy.mov

Iggy
08-08-2003, 02:11 PM
Hey James, can you give me a nutshell explanation of how the hell you did that? I'm scanning through the manual and Watkins' new book, but I can't quickly figure out how to bone my sweep. (That sounds a little odd...) When I try to duplicate your work my swept shape deforms all over the place as I try to lay in the bones. I've never worked with them before and I'm a little baffled... And where did those values in the rangemapper expression come from. They seem like pretty odd numbers.

Thanks. And we did have fun last night! :beer:

JamesMK
08-08-2003, 02:56 PM
Umm... In a nutshell - just have a look in the Maxon Tutorials book - pages 167 - 170 explain how to use set driven keys to animate a scorpion tail. When I saw your C-spring, I immediately saw the similarity :D

Iggy
08-08-2003, 04:23 PM
Ah yes, thanks, that was very helpful. I think I've got it now. It was completely eluding me this morning, but once I trashed the first practice model and moved on to the next, suddenly it was working fine... Now to apply it to the real thing. I'll post results...

JamesMK
08-08-2003, 04:56 PM
Good to hear. Trashing the first thing and starting fresh on a second usually helps for me too! :)

Iggy
08-08-2003, 05:42 PM
Well I've got my bone rig just like I want it, but for some reason I can't make it deform the object. It was working at first and then I made some modifications and then it stopped working. I tried pulling the bones out, resetting them, putting them back in to a different object, and then re-fixing them, but with no luck. I know that people take rigs around from one model to another all the time. What am I doing wrong?!

Iggy
08-08-2003, 07:40 PM
Oh MAN I'm stupid! I had turned deformers off at some point while experimenting with the bone placement and never turned 'em back on! Problem solved (after an hour of banging my head). :banghead:

Here's a pic of the setup that I used and the file. I wanted both open sides to come down evenly, so I made one length of bones and then mirrored it over to the other. It's not perfect, as when you continue to deform it you can get an unnatural looking bend at the base of the bones. Still, I'm not moving it far enough for that to be a problem. The other issue remaining is the fixed point over on the left of the spring. I would prefer if it centered around the object center. But I can accomodate that by moving the object in positive X. I've already spent *way* too much time on this fairly trivial part of the overall scene...

http://www.mechanolatry.com/images/cgtalk/C-rig.gif

C-Spring Rigged (http://www.mechanolatry.com/images/cgtalk/Spring Rig.c4d)

Thanks for the help James! You got me pointed in the right direction...

cookepuss
08-08-2003, 08:40 PM
I think that you could've achieved a very similar effect if you had just used the bend deformer with the "Keep Y-axis length" turned on.

Bendy C4D (http://www.rlsanta.com/bendy.c4d)

Check that file out. Looks more or less the same to me and with none of the rigging mess. Animates about the same too.

Iggy
08-08-2003, 09:05 PM
Yeah, you're right. I was originally trying to work with the object that I had, which was imported from Solidworks and already circular. I couldn't find any way to use bend on it without seriously deforming it, but the bones worked. But when I made a straight piece and applied the bend to it like you did I managed to produce a very accurate replica. I'm still trying to switch my brain over from my Solidworks mentality and embrace the C4D style modeling. They're very different animals...

The boning was worth the effort just to get a grip on how the tools work. But I reckon I'll use the bend object for the final, just for simplicity.

Now I can take this thing to the next level. I'll be posting the result in the next few days (hopefully!).

Thanks all.

cookepuss
08-08-2003, 09:42 PM
Here's another one you would get a kick out of.

Suppose you imported that rod-like object. You could use 2 bend deformers. You're probably thinking that you'd have manipulate each individually, right? Nope. Just create an XPresso expression attached to each bend deformer. Link them together by their strength parameters. The strength of one is the exact inverse of the other. You could even link them by angle if you want more flexibility. Again, no bones.

Check this example. Take close note of the expressions. Damn easy. I didn't have to even use a symmetry modifier this time. I created my own symmetry in the bending strengths. Since it's symmetrical, I only need to control one bend deformer. Hence, only one simple Xpresso expresion.

http://www.rlsanta.com/bendy2.jpg

brammelo
08-09-2003, 02:00 PM
Ah, the power of a node-based scripting system :)

CGTalk Moderation
01-15-2006, 07:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.