I’m doing this animation to teach kids about steam engines. I’ve looked all over the place and haven’t found any rigging tutorials or guides, at least not for C4D (if you know of any, please let me know). I’ve run several tests rigging the engine using different strategies and none quite fully worked. I remember I’d seen a YT video some time ago about someone using constraints to rig something similar, so I tested that and it was a total fiasco… headache after headache. Obviously I don’t want to do this with FK, nor do I want to go through the dynamics engine in C4D (because that’s a sure way to get more headaches!) So I landed on using joints as the best solution. And in general everything is working fine, except for this mechanism that transforms circular to linear motion. I’ve tried creating the IK chain in every way possible, and the best result I got is what you can see in test-1.gif. (I’ve also included the C4D file.) The best result was by creating an IK chain between the first and second joints, and another IK chain between the second and third joints. It “works” but, as you can see, the crosshead (the part of the blue rod that slides using the red structure as a rail) doesn’t keep to its track–and it also “pops” in the middle, inverting 180º for an instant. I don’t know how to solve either of those issues. Obviously in real life that red structure is a rail whose sole purpose is to keep the crosshead moving linearly; otherwise the physics of the thing mean that it would move as it does right now in the test-1 animation. But I’m wondering if I can somehow limit the crosshead’s goal’s motion in the Y access so that it doesn’t move up or down at all; and limit the banking on everything, as it shouldn’t rotate so much as 1º to the sides. I think I’ve gone through all the options on IK tags, and setting up poles doesn’t seem to work. As I mentioned, I would rather not go into dynamics with this. So I was thinking maybe in Xpresso I could get the crosshead’s goal to move up or down a certain amount according to–I don’t know–where the first joint is? the rotation of the wheel? … I really don’t know where to start with this in Xpresso. Right now the workaround I’m using is to manually keyframe the crosshead’s joint, which obviously isn’t ideal and I would like to learn how to better rig this sort of thing for the future. But, at any rate, the test-2-gif animation shows more or less how it should look. I’ve only keyframed the essential places where the it travels a lot in the Y axis enough. Of course, unless you go through, frame by frame, painstakingly lining it up, you’ll notice the crosshead “shake” or “shudder,” which you don’t want it to do. Plus, that “pop” is still there, no matter what I do. 😓 I’d appreciate any help or guidance toward some tutorial.
Well–it seems I got 0 bites here… it sometimes happens. Fortunately, after A LOT of tinkering I found a solution which follows the line I was working with. So for any one out there that might in future have a similar issue, I’m uploading the working C4D file for their reverse-engineering pleasure.
Basically, I fixed both issues using constraints rather than making certain objects the children of their “driving” elements. I used a Clamp constraint referencing the Rail element to block any vertical movement from the crossheads (which is what the Rail is for in real life). This solved the crosshead issue but the driving piston head still would wobble up and down, instead of remaining “connected” to the crossheads. So I realised it was because the head always pointed to that IK chain Goal, and as the Goal remained static, then as the head got farther away from the Goal, it would point over or under the rail. Of course, placing the Goal as a child of Joint 2 (the one corresponding to the crossheads) in order to get the piston head to always point to the crossheads meant instant chaos… So I parented the Goal to the Join instead, making sure to only activate Position. That only left the issue of the Joint chain “popping” at certain points, inverting on itself. I figured out that that might be because having the Joint chain as a child of the wheel (ie inside the wheel) would certainly also affect its rotation. The IK chain would try to automatically keep Up upright, but of course one can’t expect it to work 100%. So, again, constraints to the rescue: I took the Joints out of the wheel and in their place put a Null (well, I actually put a square “peg” in the C4D file, as you’ll see, to make it an obvious marker), gave Joint 1 a Parent constraint, and parented it to that Null/peg, again making sure to only activate the Position. And voilà! A perfectly working rig that does exactly what it ought to and never fails! Pheew! 😅 I was just about to give and up and decide that it was impossible without dynamics, which would’ve certainly put a hamper on my plans for further 3D experiments of the sort… no matter, all’s well that ends well!