PDA

View Full Version : How to animate this linkage?


Iggy
08-10-2003, 06:59 AM
Okay, here's a good one for ya'll. Hope someone can help me, because I've been around and around it. Take a look at this linkage.

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

Part D is a sort of coil spring. It wants to push inwards in the direction of the arrows. It is kept apart by the linkage made up of parts A, B, and C and their components. To operate the linkage, you turn the handle there between A and B. So when you turn the handle to the left, the spring pushes inwards based on the movement of parts A and C. So...

The way I've been working on it, part A is the root link. It's parent is a null whose axis is centered in the spring. This way I can rotate that link along the spring as the spring bites in. It's easy to manipulate part B based off of A. Here's the part that I'm stuck on. I need to keep part C a constant distance from part B, and at the same time keep it at a controlled distance from the center of the spring. I can't figure it out! B rotates counterclockwise around A, and C and A close in on each other, staying along the outer circle (which shrinks as A and C close in on each other).

I've got the spring animated well with a bend. But this has got me baffled. Anyone got an idea? I could possibly just try to keyframe it (though it won't be easy), but I was hoping that I could do something clever with Xpresso. Or is this a job for Soft IK? Haven't worked with that yet, so I'm not sure of its capacity. As always, thanks for any and all suggestions...

Iggy
08-10-2003, 05:56 PM
Some ideas came to me in the night on this, but I won't be able to implement them until tonight or possibly tomorrow... Got a couple of experiments to do. I post whatever comes out of it.

Iggy
08-12-2003, 04:03 PM
Here's my solution. I tried several methods of IK but couldn't come up with anything that worked to my satisfaction. So in the end I just did the math, which, though it took a while, was quite a lot of fun. Take a look at the scene file. Just drag the sphere up and down and everything actuates on its own. (Though the handle looks a little goopy in the editor, it renders spot on.) The bulk of the math is in the Xpresso on the "Hinge Assy" component. Some sweet geometry and trig...

(Incidentally, this file also is the one that I've been having weird axis/light issues with, as discussed elsewhere...)

Animated Linkage (http://www.mechanolatry.com/images/cgtalk/Sentry.zip)

Chrissyboy
08-12-2003, 05:35 PM
Originally posted by Iggy
Here's my solution. I tried several methods of IK but couldn't come up with anything that worked to my satisfaction. So in the end I just did the math, which, though it took a while, was quite a lot of fun....


Bloody nice job, Iggy, I've spent the last ten minutes moving the little sphere up and down - it's magic! I had a quick shufti at the Xpresso - what can I say, except - you must be very proud! So you kept your old trig books from school, huh? I think mine are floating around in the ionosphere...

I imagine it would have been a little bit trickier if you'd had to code it manually ;-)

Seeyou - C

danb
08-12-2003, 06:14 PM
WOW. That is great. People on this forum continue to amaze me on a daily basis. This is just another reason why i love cinema4d. Excellent job Iggy. I will be studying this scene thouroughly.

Iggy
08-13-2003, 03:34 AM
Thanks guys. :beer: It took more than a day to get it just right, but I'm neck deep in the learning curve just now, so I feel that it's time well spent. Probably spent 6 hours on the weekend going down blind alleys trying to use IK and such, to no avail. Dan, the Xpresso is a bit all over the place, because I developed the expressions a little piecemeal at first. Once I got going, all the good stuff went into the "Hinge Assy" component. If you are really interested I can describe the calcs that went into it. It's mostly pretty simple trig strung together in a chain. The Machinerys Handbook is a great resource for geometry...

wolf-cub-one
08-13-2003, 04:31 AM
I just downloaded your file. Amazing!!! Now, it's time for me to do some backward engineering.

Thanks for sharing

danb
08-13-2003, 06:39 AM
Originally posted by Iggy
Dan, the Xpresso is a bit all over the place, because I developed the expressions a little piecemeal at first. Once I got going, all the good stuff went into the "Hinge Assy" component. If you are really interested I can describe the calcs that went into it. It's mostly pretty simple trig strung together in a chain. The Machinerys Handbook is a great resource for geometry...

This is precisely the reason why i am sticking with Cinema4d. xpresso and tp can do some amazing things. Iggy you said you could describe the clacs that went into it. That would be great. And i will check into that machinerys Hand book.

I would love to learn how to do things like this to complement my animations. i could use these types of mechanical objects in some of my concepts. And i really hope someday i can do this type of work. Mathematics is not my strong suite. That said i am very eager to overcome that. I am amazed something like this has come across my way.

BTW, i noticed the use of normal tags in your seen. I can't seem to find these things in cinema. Can you help me out there.

brammelo
08-13-2003, 11:18 AM
Wow Iggy ... what can I say? I'm impressed!

Next time someone asks me what can be done with this little applications of ours, I'm gonna show him your file as a first class XPresso example.

Kind regards,
BaRa

Iggy
08-13-2003, 12:37 PM
Thanks Brammelo! :beer:

Dan, the normal tags are a quirk of the way I get my parts. These parts were made originally in Solidworks and imported into Cinema via Polytrans. For some reason these normal tags get attached. I didn't mess with them at all. However, I was having a weird problem (you may have seen the post) where when I rotated the axis of parts the direction of incident light on them would change, disregarding the actual light direction. However, if you just trash all those tags some of the parts wind up with strange artifacts, so I left most intact and just stripped out where I was having a problem. (BTW, it was Sadie who figured out what was happening there. I was stumped...) And the Machinery's Handbook is a thick technical resource for engineers and machinists, but it has a *great* section on coordinate systems, geometry, and trig in the beginning. You could probably get it at the library and just xerox the good stuff.

Well, I have to say that I'm pleased that people are impressed. Around here I generally feel that I'm flailing around trying desperately to learn enough to catch up to all the pros...

danb
08-13-2003, 01:28 PM
Thanks again Iggy for the reply and i am definately going to check out that book. Although after i reinstall everything again. I got hit hard by that MSWorm thing last night and i had to format and reinstall XP. I am sooo Pieved. I had so many good resources from this board all ready to be archived. :scream:

AdamT
08-13-2003, 01:54 PM
Very nice Iggy! Man, I couldn't have come up with that in a million years.

The normal tags are there to help Cinema's Phong shading algorithm deal with imported meshes. This was a much-needed addition to v.8.1. It prevents a lot of shading artifacts that can occur with imported meshes--particularly from tesselated nurbs meshes. AFAIK they are only supported with .obj import, so it's best to use .obj for these situations if possible.

Iggy
08-13-2003, 02:17 PM
It's good to know why those are there, thanks Adam. These parts were imported as VRML, so perhaps it's supported there as well? And those tags were the cause of my strange lighting problems. Any idea why they do that? In the future on my imports, I think that I will just add parent nulls to any object that needs axis tweaking, so that I can leave those tags alone.

AdamT
08-13-2003, 02:41 PM
Originally posted by Iggy
It's good to know why those are there, thanks Adam. These parts were imported as VRML, so perhaps it's supported there as well? And those tags were the cause of my strange lighting problems. Any idea why they do that? In the future on my imports, I think that I will just add parent nulls to any object that needs axis tweaking, so that I can leave those tags alone.
Hmm, I didn't know VRML also supported normal tags. But wasn't it some other tag that was causing your problems? Maybe Maxon needs a bug report on the VRML import?

Iggy
08-13-2003, 02:47 PM
Nope. It was the normal tags. On the objects having lighting troubles, as soon as the normal tags were deleted, the lighting became correct again. I did wind up with artifacts on some of those parts. Some just needed the phong tag adjusted, but some are not reparable and have to be replaced or repaired. (Most parts had no trouble, because on most parts I did not need to adjust the axis rotation.) So what I understand you saying is that the normal tag is not supposed to work like that? That it shouldn't normally affect the lighting like it did here? If that's the case, I'll report it.

Iggy
08-14-2003, 01:24 PM
Thanks for the great responses. A couple of people have said they'd like to see a tutorial. Are more folks interested in this? I mean, it'd be more a tut on geometry and trig than anything else. If people think that they won't glaze over reading about math, I'll work one up in the next couple of weeks. Let me know.

CGTalk Moderation
01-15-2006, 08: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.