View Full Version : Creating mechanical rigs with IK?
NightEye
13th May 2008, 05:43 PM
Hello guys, long time no see!
I'm trying to get into depth with animating, and even the easiest video that talks about bones is too confusing. Also, the Piston IK tutorial is really nice, but when I try to replicate that in a different rig (I tried to make an excavator arm) it all fails completely.
A while back I wanted to pick things up and built a simple bridge like on the photo. I tried to work with nulls, with bones, with IK, but all failed. Is there a good way to do this with either methods? Or are there any tutorials that cover the why and how about IK, and not just the how?
Thanks,
Arjen
ALp
13th May 2008, 10:23 PM
Hi , Arjen , I do not know about the why vs how tutorials, but I can help you with the bridge's why.
What shown in the photo is a basic parallelogram design. What you should know is that though object/layer IK is the same as the bone's IK, it is slightly different.
But lets start it simple. For the first way to do this, instead of using full-blown IK you will use the target settings (assuming you are using LW6.x and up)
STEP 1.
Build the land-part of the bridge with the vertical arm in layer1. The model should be aligned in Modeler so it points toward the positive Z axis, i.e. the river should be on the POSITIVE Z-Axis SIDE.
STEP 2.
Now build the top and bottom bridge parts in horizontal position, each in its own layer (2 and 3), and place the pivot points accordingly at the centers of each rotation axis. Parent both of them to the base using the layers window (F7)
STEP 2.5
LW's Targeting system is using the Z+ direction FROM THE PIVOT's POSITION to calculate the rotation of the item, so make sure the 4 axis (2 back (land-side) and 2 front (river-side)) are of the same Y and Z coordinates (wherever it counts ofcorse). What I mean is, the rotation axis should line up properly both in top/bottom and in front/back views.
If the axis do not line up the targeting animation method will result in the axis moving off and on, out of the appropriate holes.
And now to the tricky part.
STEP 3
Build the riverside connecting arms in layer4 and parent layer4 to layer1. Name the layers accordingly , ofcorse. Save and send the object to layout.
STEP4
In layout , add 2 nulls , call them top and bottom, parent them to the connecting arm (layer4 of the object) and place them on the top and the bottom axis respectively. MAKE SURE they are co-aligned with the pivots of the top and the bottom bridge parts.
STEP5
In motion properties ('m' key) of the top and bottom parts select the top and bottom nulls respectively.
STEP6
YOU ARE DONE :) simply move the riverside connecting arms object up and down and you will see the bridge will work.
I will post some pictures later on to upgrade this tutorial, and next time I will show you how to use IK to achieve the same effect. You will understand the difference and similarities of both IK/FK and Targeting in LW and will be able to select the technique suitable for each animation task you have in the future.
NightEye
14th May 2008, 04:41 AM
Thanks for your quick answer :)
I thought about doing it this way, but banished it from my head because it doesn't quite look good (no offense). The thing is, they should behave like trusses (two pivot points). So the base of the connectors should stay at its position, aswell as the top.. Do I make sense :D
But I tried it anyway, and I must say the result brought me further than I had been :p So thank you.
I can't wait to see what you got more about IK :)
Rigel
14th May 2008, 06:49 AM
Hi Nighteye;
I described this system in Animation 101, here (http://www.foundation3d.com/forums/showthread.php?t=1907#6). The part you are interested in is Lesson 5, where I demonstrate how to IK chain a hydraulic system. The only difference between that and your bridge is that your "hydraulic" (vertical brace) is one piece instead of two.
NightEye
14th May 2008, 08:21 AM
I've read that part, and watched the video. I can manage to do that and it will work. But the problem with this bridge is, that it has two pieces that should react with each other when you move one (when you move the top part, the verticle rods and the road should move along). I've tried to use a similar rig like the pistons, but somehow it just doesn't work.
Actually another problem is that the verticle rods aren't really verticle, but at a slight angle. That makes it even harder :/
I will try to come up with something in the next few days, and perhaps it will work then. If not, I'll wait and see ALp's ideas :)
Rigel
14th May 2008, 08:07 PM
I've read that part, and watched the video. I can manage to do that and it will work. But the problem with this bridge is, that it has two pieces that should react with each other when you move one (when you move the top part, the verticle rods and the road should move along). I've tried to use a similar rig like the pistons, but somehow it just doesn't work.
Actually another problem is that the verticle rods aren't really verticle, but at a slight angle. That makes it even harder :/
I will try to come up with something in the next few days, and perhaps it will work then. If not, I'll wait and see ALp's ideas :)
OH! Now I understand your problem.
Okay, it's called a Follower modifier in the Motion Options panel.
You should probably control the entire thing with the road section. So, to get the upper part to react hit M for motion options on that part.
Click the drop down labelled Add Modifier then choose Follower. Edit the properties for follower. At the top it says Item To Follow; in there, select your road layer of the model.
Below that is a list for each of the channels which can be affected. To be safe, set every one of them to None, except for the P (pitch) channel; leave it set to Pitch. I assume you will be rotating the road section on the Pitch channel to raise it.
Close those windows. Now pitch your road object upwards and you will see your upper section rotate upwards as well.
NightEye
22nd November 2008, 01:37 AM
I'm sorry for the late reply, but I finally got bones and IK worked out. I now understand the how and why, which brought me much further :)
If anyone is interested, here is the scene file and object.
Thanks for your help.
jorjo
22nd November 2008, 02:25 AM
I'm sorry for the late reply, but I finally got bones and IK worked out. I now understand the how and why, which brought me much further :)
If anyone is interested, here is the scene file and object.
Thanks for your help.
Help?
If ever you could be been sent barking up the wrong tree and into the most convoluted screwed up way to do this, YOU got it. !
This is hard body stuff. I wish I'd seen the thread sooner.
I remember the outcome when I introduced Rigel to bones years back for use on a "rubber" flexi joint and he recommend them for everything except what they are meant to be used for a long time before I noticed.. :o My Bad ! We've been making up for that ever since :)
Ok.. so you where quite right to start with.. hard body rigs use pivots.. or chains of pivoted parts and ending up with needing a last pin to finish on which is as simple as adding a null or two for it in Layout and couldnt be easier ! you do most of it much the same as a real world build over in modeler and place the pivots there per part (hence the reason why we have layers !) Then In layout the already parented and pivoted parts just need a few goals and instruction and its good to go.
here's the scene sorted as you expected to be able to do it. fixing that was 3 minutes kinda easy. fixing the notion that you'd ever want to use bones for it is something that may take a little longer :o
17810
Pull it apart and have a look.
each moving part gets a layer.
base in layer one.
the bridge in layer 2 with the pivot where you'd expect it to be and rotated by keyframes
the upright support in layer three parented to the bridge and pivoted logically where its attached and since it needs to be IK it's set to IK
next in the chain it the top span so it parented to the bar and pivoted there to continue the chain and logically set to ik
that leave us needing to pin it at the back to the main support. so we add a null to the top support and parent it to the support to continue the Ik chain that far.. and since we need a matching pin on the main base we add another null in the same place and parent that to the base (think of the two nulls as being like a hole drilled in each bit up there and then setting the null on the top arm as having the null on the base as a goal is like pushing in a pin to keep them in place) and tick the keep goal in reach is the pin that keeps them together. It would work just as well with the set up going in the opposite direction by starting the chain at the top span and ending with nulls down at the bridge if you wanted to control it from the top part (that would involve reversing the parenting and the pivot placements too)
each part from the bridge onwards in the chain that need to move is simply set be controlled by IK in motion option.
once again I am sorry I didnt see the thread sooner. It would have saved you a whole pile of messing around..
Bones are designed to be used for Deformations. Pivots are there for anything that need a pivot or a hinge Just as layers are there for moving parts with a pivot per layer with the parenting window in modeler for assigning them to their parent units. If you need anything more on how to set it up. feel free to pm :tu:
anyhow.. short version is start at one end, place pivots in modeler for where each part rotates on it parent and add the last pivot and goal/ anchor point as nulls in layout. tell each part it's controlled by IK and the nulls at the end are the equivalent of putting the pin in the hole at the end by "keep goal in reach".
NightEye
5th December 2008, 12:32 AM
Perhaps I was sent the wrong direction, but I learned a lot out of it :) I now got some control with bones (on humans and on hard body - although it's a pain in the ***). No problem you didn't see this any earlier, I'm glad actually.
Your attachment isn't working, but I followed your description and I got it working within 2 minutes! Never thought it was that easy :wtf:
I want the top part to control everything instead of the bridge itself, but that's a matter of reversing; I can manage to do that now I think :D
Thinking of doing an excavator rig with pivots now. I already did one with bones, but pivots is way easier.
http://nighteye.zanderz.net/images/portfolio/61/graafmachine-01.thumb.jpg (http://nighteye.zanderz.net/images/portfolio/61/graafmachine-01.avi)
Small video
Thanks again, can't thank you enough!
jorjo
5th December 2008, 12:55 AM
Your attachment isn't working, but I followed your description and I got it working within 2 minutes! Never thought it was that easy :wtf:<>
Thanks again, can't thank you enough!
Your welcome.. :tu:
NightEye
5th December 2008, 01:07 AM
I'm actually working on the Gray and Housman truck of yours now. It will probably learn me a lot more again :)
jorjo
5th December 2008, 01:36 AM
I'm actually working on the Gray and Housman truck of yours now. It will probably learn me a lot more again :)
Great to have yah onboard, It will give you a base rig for that excavator too :tu: