View Full Version : Animating a mech leg with hydraulics

01-16-2004, 06:48 AM
I've modelled a mech, and the legs are operated by hydraulics.
The knees point backward like a birds legs and in between the upper and lower legs I have a hydraulic pump (or whatever theyre called). I've managed to animate the leg nicely by boning the two halves of the leg, and using the foot as a goal. My problem is the hydraulics in between.

I saw the tutorial at http://www.niklasindustries.com/tutorials/tut_hydraulics.htm and I understand the idea there. The problem is that the base and end of the hydraulic move according to the leg.

I've managed to get the top of one hydraulic to follow its base using expressions. But the base is more complex because of the second pivot in the knee.

I'm not sure if anyone follows but I'll attach a pic of what I have. I'm really just looking for any kind of solution at the moment. I've spent hours tonight revisiting maths, trying to find a way to come up with an expression to suit my needs, but I'm now convinced I can not do it the way I planned.

So, any help would be greatly appreciated.

Heres the leg...
Hopefully you can work out what I'm talking about..
Btw, the hydraulics are all seperate objects, upper and lower parts. The two parts of the leg are one, and the foot is seperate.

01-16-2004, 11:58 AM
Use targeting...

01-17-2004, 01:29 AM
Thanx a lot for that. Although it didn't help me directly it did point me in the right direction.
Using point at target for the pistons made them point in wacky ways, so instead I used IK with a null for each piston part to indicate its tip and used the opposing piston end as the goal. With everything parented correctly it works _almost_ perfectly.
At least I'm well on the way to getting it working exactly how I wanted.
Thanx again.

01-17-2004, 05:51 AM
If you intend doing a lot of this kind of stuff, You might want to have a look at Fi's Bezier Bend (plug in) Flay.com or if you have the cash check out steve worleys hoser plugin. I'd check em out anyway.



01-17-2004, 07:06 AM
Originally posted by instinKt

Using point at target for the pistons made them point in wacky ways.

Point your pistons down the + z-axis in modeler for it to work correctly. If you build them in the right direction for your robot, you can use the rotate tool with 'Use pivot point' in the mode centre (the little drop down at the bottom of modeler's interface) to rotate them into the right direction. That is of course if you have the pivot point set up in modeler(which you should do if you've built a robot.)

Take a look at my object in modeler to see what I mean :)

IK can work too, but it can pull the foot away from it's goal if not set up right :P

01-18-2004, 07:11 AM
I do know what you mean and I understand how it works now, and yes the pivot points are all setup correctly in modeller :)
I also noticed that IK pulls the leg away from its goal, and I fixed that (kinda) by adjusting the goal strength for them. Although it still pulls slightly. So eventually I will probably do it your way.

01-18-2004, 09:22 AM
Just out of curiosity, why do you use bones in a "Hard" object? Couldn't you just make the hiarchy in parts?

01-18-2004, 07:55 PM
Lol, yes that's how it's being done now.
I've only been using lightwave for about a week now, and I'm still learning how everying works. :)