Rigging Robotic Joints in 3D Studio Max

Like most tasks in 3D Studio Max and similar products, rigging robots is easy, if you know how. Depending on the complexity of the robot, some may find it even easier than rigging a human or animal character. This is because most parts of a robot do not deform during movement, with the exception of cabling and other flexible parts, so you don’t have to ‘skin’ it. One of the primary challenges in building a cool robot, which still looks cool when animated, is creating realistic mechanical joints. Although you may prefer a simpler look for your robot, during this tutorial we will assume you want to aim for realism.


The first version of our example robotic leg below is not very realistic however, because it would collapse like a bone structure without muscles. In the second version, we will add some robotic ‘muscles’, and the third version will include a hose. Click on the download links below some of the pictures to download the corresponding scene.

1. A Human Leg

When rigging a human leg, the mesh deforms when the knee bends, pushing vertexes away from each other on one side and towards each other on the opposite side. This is accomplished by using a Skin modifier that binds vertexes of the mesh to the bones. The colors of the vertexes indicate the weight values which dictate how much influence moving the joint will have on those vertexes. Red vertexes represent the most rigid parts.

2. Our Example Robot Leg

Robots are typically made of metal, plastic, or some other hard and rigid material that does not deform. Picture 2a shows the five objects that form the basis of our example leg.

clip_image001clip_image002
Picture 2a. Picture 2b.

3. Rigging Our Example Robot Leg

As usual, I have to make a note that the following is just a way of doing this, which doesn’t necessarily means it is the way (we’ll actually show another way later on). Picture 3a below shows the (unsmoothed) wireframe of the objects that make up this leg. Click the link below it to download the scene, or download the scene including the bones by clicking the link below Picture 3h, or just watch the pictures if you do not feel like actually doing any of this right now.

clip_image003
Picture 3a.

Download scene here (robotleg_start.zip)

The red dots in the picture above represent the pivot of the object. In the scene you can download, I have already moved them to the correct position. The UpperLeg’s pivot is positioned at exactly the same position as the pivot of Cylinder01, and LowerLeg’s pivot is at the same position as the pivot of Cylinder02. When switching to the top view, they are all aligned. It is essential that the bones you add start or end exactly at those pivot points.

A way of making sure the bones are positioned correctly is to snap to pivots. When you use this method it is also essential that all the pivots are aligned when viewing from the top. If in your robot they aren’t and it is too complex or difficult to align them, you can skip the following snap settings and just draw the bones, select them all and move them to the center of the leg (Top view). To use the snap setting, right-click the Snaps Toggle button on the main toolbar and select Pivot and clear others if necessary (see Picture 3b). Now click the Snaps Toggle button again (with the left mouse button) to enable it.

clip_image004
Picture 3b.

Click the Bones button in the Systems section on the Create tab of the Command Panel as displayed in Picture 3c below. Choose SplineIKSolver as the IK Solver and enable Assign to Children (you can use another IK Solver or none at all, if you prefer).

clip_image005
Picture 3c.

Now draw the bones, by clicking on the spots 1, 2, and 3 shown in Picture 3d and then right-click anywhere in the viewport to stop. Spots 1, 2 and 3 are the pivot points of Cylinder01, Cylinder02, and Cylinder03.

clip_image006
Picture 3d.

When the Spline IK Solver dialog shown in Picture 3e below opens, just click OK.

clip_image007
Picture 3e.

Now before you link the bones to the leg, you should make sure that the pivots of the bones are positioned correctly on the pivot of the limbs, the Spline IK Solver we added moved them slightly. To move a bone’s pivot, click the Affect Pivot Only button on the Hierarchy tab of the Command Panel, and disable the Enabled button on the Motion tab of the Command Panel.

clip_image008
Picture 3f.

Then select the pivot of the bone and move it to the correct position. Make sure you zoom in and place it exactly in the center of the limbs’ pivots. You also might want to disable the snap to pivot setting first by clicking the Snaps Toggle button again. If for some reason you cannot get them in the right position, there is no need to continue, as the whole setup depends on the pivots’ position.

When you are sure the pivots are positioned correctly, select Cylinder01 and link it to UpperLeg. Select Cylinder02 and link it to the LowerLeg, and select Cylinder03 to LowerLeg as well. To link one object to another click the Select and Link button on the main tool bar, select the object you want to link and drag to the object you want to link to. If you do it correctly, the object you link to, will flash white once.

We will use the same select and link method to link the objects to the bones, instead of using a Skin modifier. Link UpperLeg to the upper bone, and link LowerLeg to the lower bone.

clip_image009
Picture 3g.

When you done all of the above, or download the scene including the bones by using the link below, select the IK Chain or any of the point helpers and move it. The knee joint should now operate as shown in Picture 3g, without any of the objects deforming during movement.

clip_image010
Picture 3h.

Download scene here. (robotleg_end.zip)

4. Another Approach

Before we continue with this leg and add some muscles, we will use another method of rigging this leg. As someone kindly pointed out to me, there is no absolute need to use bones . If you are new to rigging characters or robots in particular, you may want to go for the bones method discussed above, but a robot is often a skeleton by itself, eliminating the need for bones. 3D Studio Max allows any object to act like a bone, and allows you also to assign IK solvers to any hierarchical set of objects. Also in this type of ‘bone’ setup, it is absolutely imperative that the pivots of the objects are in the correct position. We will illustrate this with some pictures later.

To make this work with the previous example (delete the previous bone structure or use the scene you downloaded earlier), and link the objects to each other as followed:

Cylinder03 à LowerLeg
LowerLeg à Cylinder02

Cylinder02 à UpperLeg

UpperLeg à Cylinder01

Press the Schematic View (Open) button on the main toolbar to check if the hierarchy is now correct as displayed in Picture 4a.

clip_image011
Picture 4a.

Now all you need to do is add an IK Solver to this hierarchy to make it act like a robotic leg. You can use the IK Solver you prefer, but in this example, we are going to use the History Independent solver. Select Cylinder03, choose HI Solver from the IK Solvers section in the Animation menu, and select Cylinder01. To prevent you from linking the solver to UpperLeg instead of Cylinder01, use the Select by Name option, which basically means you should press the H key on your keyboard after you choose HI Solver from the menu, and then pick Cylinder01 from the list, instead of clicking on it in the viewport.

If you performed the previous tasks correctly, the results should be like in Picture 4b with the IK Chain selected. If you move the IK Chain the leg should work. To make the task of animating this leg a bit more convenient, you should link the IK Chain to a Point Helper.

A Point helper can be created by clicking the Point button in the Helpers section of the Create tab on the Command Panel, and clicking somewhere in the viewport, as depicted in Picture 4b below. In this case, I suggest you place it somewhere at the bottom of the leg. Use the same Select and Link method as discussed earlier to link the IK Chain to the Point helper, so you can animate the leg by moving the Point helper.

clip_image012
Picture 4b.

If your robot has a complex geometry and animating the individual objects slows down your computer too much, you can configure 3D Studio Max to display the objects as bones. When using our example leg from the previous steps, you should select Cylinder01, 02, 03, UpperLeg, and LowerLeg, and select Bone Tools from the Character menu. Enable the Bone On option on the Bone Tools dialog as shown below.

clip_image013
Picture 4c.

Next, open the Display tab on the Command Panel, scroll down, and in the Link Display section enable the Display Links option and the Link Replaces Object option.

clip_image014
Picture 4d.

The results should be as depicted in Picture 4e below.

clip_image015
Picture 4e.

Alternatively, you can enable only the Display Links option and right above the Link Display section enable the Display as Box option in the Display Properties section. The results should be as depicted in Picture 4f below.

clip_image016
Picture 4f.

Download the scene here. (robotleg_ik_end.zip)

5. Muscles

As I mentioned earlier, the leg used in the example above is not very realistic; it needs some muscles to make it move automatically and at the same time give it some strength. You can make up your own mechanisms, but you can also use one of the three main methods used in modern real world robots:

Electrical motors

For the example leg from above, this would be the easy way out, as you would ‘only’ have to increase the size of the knee joint and modify it into to something like shown below in Photo I, so it becomes viable an electrical motor could fit inside. Additionally, rigging the robot is easy as you can use one of the methods we discussed earlier.
clip_image017
Photo I. Industrial robot arm powered by electrical motors.

Hydraulic/Pneumatic/Magnetic pistons

Another commonly used method to power robots are pistons. A piston (see Photo II below) is basically consists of a metal bar that goes inside a tube. Pressurized air or oil is pumped into the piston to push out metal bar. This is usually the sound you here when a robot moves. If you want to make them realistic, you should attach a hose to it, which leads to a compressor somewhere in or on the robot. These hydraulic or pneumatic pistons are much more powerful than electrical motors. Smaller pistons may use magnetic force to either pull or push the metal bar. The latter would have electrical wires attached to it, instead of a hose.

clip_image018
Photo II. Crane powered by hydraulic pistons.

Picture 5a and 5b show our second example leg. It includes a piston that is made of two cylinders called Piston_PA and Piston_PB. Two additional cylinders (P_Axis_A and P_Axis_B) form the axis of the piston’s parts.

clip_image019clip_image020
Picture 5a. Picture 5b.

As you can see in Picture 5c below, we already rigged the leg with two bones and an IKSplineSolver. You can download the scene by clicking the link below the picture.

clip_image021
Picture 5c.

Download the scene here. (robotleg_pistons_start.zip)

First, we will link the piston’s parts to the leg as followed:

P_Axis_A à UpperLeg
P_Axis_B à LowerLeg

Piston_PA à P_Axis_A

Piston_PB à P_Axis_B

The hierarchy of the leg should now be exactly like in Picture 5d.

clip_image022
Picture 5d.

If we would bend the knee, by using the lower helper (Point3) for example, the two parts of the piston will not stay aligned correctly and will ‘break’ as shown in Picture 5e below.

clip_image023
Picture 5e.

(If you moved the leg, press use Undo (Ctrl-Z) to move it back to its original position.)

To make sure the metal bar stays inside the tube, we need to use a constraint, in this case the Look At constraint. As in the previous parts of this tutorial, the placement of the pivots of the piston’s parts is essential to make it work. The pivots for P_Axis_A and Piston_PA are exactly on the same position, and the pivots for P_Axis_B and Piston_PB are also exactly on the same position. We have already done this in the downloadable scene by selecting the parts that have the pivots on the same axis, enabling the Affect Pivot Only button (see Picture 3f) and using the Align tool (on both the Front, Top, and Left view).

We will need to add two Look At constraints, one for each part of the piston. Select Piston_PA and select Look At from the Constraints section in the Animation menu, as depicted in Picture 5f below.

clip_image024
Picture 5f.

Press the H key on your keyboard, select P_Axis_B, and click the Pick button. Piston_PA now changes its orientation. To make sure it point in the original direction, enable the Keep Initial Offset option on the Parameters section on the Motion tab of the Command Panel, as depicted in Picture 5g below. (The parameters section opened automatically when you added the Look At constraint.)

clip_image025
Picture 5g.

Repeat this step for the other part of the piston, in other words: select Piston_PB, select Look At constraint from the Animation menu, pick the P_Axis_A as the target (using the H button to pick it). Also enable the Keep Initial Offset option again. So what we did is make one part of the piston ‘looks at’ the opposite part’s axis. The orientation is depicted with a blue line. If you select the helper Point03 and move it again, you will see that the metal bat slides neatly into the tube, as shown in Picture 5h below.

clip_image026
Picture 5h.

Download the scene here. (robotleg_pistons_end.zip)

To make it more realistic, we need to attach a pipe or hose to the hydraulic or pneumatic piston, and we need to make sure it moves and/or bends when the leg moves. There are many ways of doing this, but a relatively easy one is to use the extended primitive Hose. The advantage of using the Hose primitive is that you don’t need to rig it; no bones, and no IK. Instead, we are going to add two extra Cylinders, in addition to the Hose, and let the Hose start and end at those cylinders.

In Picture 5i below you can see where we placed the two cylinders. The cylinder on the left is linked to UpperLeg, and the other is linked to Piston_PA. These cylinders represent the entry points of the hose, or the connector of a wire for example. You will probably want to use something more sophisticated than a cylinder, but make sure it is a separate object.

clip_image027
Picture 5i.

Next, create the hose by selecting Extended Primitives on the Create tab of the Command Panel, clicking the Hose button, and drawing a hose in any viewport, as shown in Picture 5j below. Don’t worry about its size, location, or shape yet.

clip_image028
Picture 5j.

On the Modify tab of the Command Panel, enable the Bound to Object Pivots. Click the Pick Top Object button and click on the left cylinder. Click the Pick Bottom Object button and click on the right cylinder (or use the H key on your keyboard).

clip_image029
Picture 5k.

Depending on the orientation of the cylinders we use to connect the hose and the viewport you created them on, you may have to rotate the pivot of one or both cylinders. So if necessary, select the cylinder, enable the Affect Pivot Only button (picture 3f), and rotate the pivot. While you rotate the pivot, the hose will bend with it so you can easily see when it is at the right angle.

When the hose is correctly aligned to the cylinders, click the hose again, scroll down below on the Modify tab, and disable the Flex Section Enable option as shown below in Picture 5l. Also decrease the Diameter: value in the Hose Shape section to a value that is less than the cylinders.

clip_image030
Picture 5l.

As you can see, the hose is too long and needs to hang more tightly against the leg. You can do this by decreasing the Tension values (see Picture 5k). In the final images below, we used 25 for both cylinders. If you move the leg again using on of the helpers, you will notice that the hose will stay in position and even bend when it has to. Click on one of the images to see the final animation.

clip_image031 clip_image032
Picture 5m.

Download the final scene here. (robotleg_piston_hose.zip)

I hope you enjoyed this tutorial and that it contributed something to your 3D Studio Max modeling skills.

This tutorial is created originally for 3Dvalley.com. You are not allowed to redistribute this tutorial in any form.

This entry was posted in Tutorials and tagged , , , , , , . Bookmark the permalink.
Share/Bookmark

25 Responses to Rigging Robotic Joints in 3D Studio Max

  1. Prashant says:

    Mike,

    First time viewer of your tutorial. Awesome tutorial but I couldn’t find any of the download links you refer to in your Rigging Robotic Joints tutorial. Any chance you can send me the final 3D max scenes so I can take a look at what you did? I was using the tutorial and I think I goofed somewhere because the one I did didn’t work like you described so I just wanted to see how yours was and if I missed something. Thanks.

  2. pepito says:

    Just perfect thats what im looking for. cheers

  3. Murilo says:

    thanks a lot! :D

  4. Raptor says:

    awesome men, great tut. :p

  5. Frank says:

    Really good, I’ll try it at home today.
    Thanks for sharing your skills.

  6. berky93 says:

    Great tutorial – there is a lot of information here, which is useful even if you arent making a robotic arm. definitely helped me a lot. I think I’ll be using this info a lot in the future (I love robots)

  7. s kumar says:

    good… everything is crystal clear, useful one.

  8. xperia001 says:

    Have been looking for this since a long time ago!!

  9. TheDon says:

    “and disable the Enabled button on the Motion tab of the Command Panel.” Can’t find this (3DSMax8SP3) in the motion tab, and the help file ain’t much of a help either. Could somebody please describe where to find this button? Cheers.

  10. Miguel Á. says:

    Hola y Saludos de México D.F. esta exelente ejemplo del robotleg_piston_hose.zip ok Bye

  11. Zorkiel says:

    Thanks, this helped greatly with a current project

  12. Flavio says:

    I really want to thank you!! your totrial is awesome and helped me a lot!!!
    Thank you very much!!!

  13. Mike Nuts says:

    @TheDon: I wrote this tutorial for 3D Studio Max 7 (if I remember correctly) and it’s very possible some options have changed in newer version. However since the tutorial covers several different methods I assume you can still achieve the end results. (let me know anyone if that’s not the case).

    And thanks for the kind comments all. :)

  14. Rob Holmes says:

    Nicely crafted tutorial. I like that you showed alternative methods and explained what several aspects are instead of just directing “click here, then here, then here.” Thanks…

  15. DM says:

    I’ve gone through this tutorial on 3ds Max 2011 x64 and am having problems with the look at constraints. When I add a look at constraint from the first part of the piston to the second part of the piston it’s fine, but then trying to add a look at constraint to the second part of the piston back to the first part I’m not allowed to select the first part. Any ideas why this is happening?

  16. Peccatrix says:

    Fantastic, just what I was looking for, been looking for a piston solution for a while now. Thank you!

  17. Excellent tutorial. Clear & concise. All I need to do now is work out how to create a piston just on its own. So I can start rigging furniture like cabinet drawers etc..

    Thanks!

  18. Morten says:

    Hi, this may be a long shot, but how would you do rig the example picture with electrical motors? I cant seem to figure it out when the “bones” are shifted in one direction. Im guessing a constraint, but can you give a hint?

  19. lusu says:

    Can somebody help me with an tutorial on how to make the robotleg all by myself.
    i’ve tried but something’s not working

  20. Cakewalkcg says:

    Hi,

         I also like to share few good tutorial resource on rigging in 3ds Max here…..

    http://www.cakewalkcg.com/tutorials/3ds-max/rigging

    Regards,
    Cakewalkcg

    ——————————————
    Visit http://www.cakewalkcg.com for free 3D models and video tutorials. 

  21. Orochi663 says:

    Hi,
    Great tutorial, I was wondering how to connect two bones to same object apparently only one bone can be parent of the object, I got this scenario where i have to move an object on two pivots.

    Regards,

  22. RabbiJoe says:

    Hey cheers for the tutorial, I’m a student i have a blog for my college and would like to very much make a Maya version of this tutorial for my class mates to follow along with. if i do this i will credit you showing them a link to this tutorial as i think it will end up on youtube anyways wanted to ask first. 
    cheers again! :)

  23. ShinRa says:

    Thank you! Great tutorial!! :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>