3ds max advanced tutorial: create a robot model with skeletal animation

Recommendation: NSDT scene editor helps you quickly build 3D application scenes that can be redeveloped

However, the first version of our example robot leg below is not very realistic as it would collapse like a skeletal structure without muscles. In the second version we'll add some robotic "muscles" and the third version will include the hose. Click the download link below some pictures to download the corresponding scene.

1. A human leg

When rigging a human leg, the mesh deforms when the knee bends, pushing vertices away from each other on one side and closer to each other on the other. This is achieved by using a skin modifier that binds the vertices of the mesh to bones. The colors of vertices represent weight values ​​that determine how much moving joints affect those vertices. The red vertices represent the most rigid parts.

2. Example of our robot leg

Robots are usually made of metal, plastic, or some other hard and rigid material that won't deform. The image below shows the five objects that form the basis of the example leg.

3. Assembling our example robot leg

As usual, I have to note that the following is just one way of doing this, which doesn't necessarily mean it's the way (we'll actually show another way later). Figure 3a below shows the (unsmoothed) wireframe of the objects that make up this leg. Download the scene by clicking the link below it, or download the scene including the skeleton by clicking the link below picture 3h, or just watch the picture if you don't want to actually do any of that right now.

The red dot in the image above represents the object's pivot. In the scene you can download, I've moved them to the correct location. The UpperLeg's pivot is at the exact same location as Cylinder01's pivot, and the LowerLeg's pivot is at the same location as Cylinder02's pivot. When switching to top view, they all line up. The bones you add must start or end exactly at these pivot points.

One way to ensure bones are positioned correctly is to snap to pivots. When using this method, it is also important that all pivots align when viewed from the top. If in your robot they are not, and aligning them is too complex or difficult, you can skip the snapping setup below and just draw the bones, select them all and move them to the center of the legs (top view). To use the snap settings, right-click the Snap toggle button on the main toolbar, then select Pivot and clear the other buttons if necessary (see Figure 3b). Now click the snap button again (with the left mouse button) to enable it.

Click the Bone button in the System section on the Create tab of the command palette, as shown in Figure 3c below. Select "Spline IKSolver" as the "IK Solver" and enable "Assign to Children" (you can use another IK solver if you prefer, or no solver at all).

Now draw the bones by clicking on points 2, 3, and 3 shown in Figure 1d, then right-click anywhere in the viewport to stop. Points 1, 2, and 3 are the pivot points for cylinder 01, cylinder 02, and cylinder 03.

Just click OK when the Spline IK Solver dialog box shown in Figure 3e below opens.

Now, before attaching the bones to the legs, you should make sure that the pivots of the bones are correctly positioned over the pivots of the limbs, the spline IK solver we added will move them slightly. To move the bone's pivot, click the Affect Pivot Only button on the Hierarchy tab of the command panel, then disable the Enabled button on the Motion tab of the command panel.

Then select the bone's pivot and move it to the correct position. Make sure to zoom in and place it exactly in the center of the limb's pivot. You may also want to first disable the Align to Perspective setting by clicking the Alignment toggle button again. If for some reason you can't get them in the correct position, there is no need to continue, as the entire setup depends on the position of the pivot.

When you're sure the pivot is in the right place, select Cylinder01 and link it to UpperLeg. Select "Cylinder 02" and link it to the "Calf", and select "Cylinder 03" and link it to the "Calf". To link one object to another, click the Select and Link button on the main toolbar, select the objects to link, and drag to the object you want to link to. If done correctly, the object you linked to will flash white once.

Instead of using the Skin modifier, we'll link objects to bones using the same selection and link methods. Link the thigh to the upper bone, and the lower leg to the lower bone.

Once you've done all of the above or downloaded your scene including bones using the link below, select the IK chain or any point helper and move it. The knee joint should now operate as shown in Figure 3g, without any objects deforming during the motion.

4. Another way

Before we move on to this leg and add some muscles, we'll use another method to rig this leg. As someone kindly pointed out to me, there's no absolute need to use bones. If you're particularly new to rigging characters or robots, you might want to opt for the bone approach discussed above, but robots are usually a skeleton themselves and don't need bones. 3D Studio Max allows any object to act like a bone and also allows you to assign an IK solver to any set of layered objects. Also in this type of "skeletal" setup, it is absolutely necessary to have the pivot of the object in the correct position. We'll illustrate this later with some pictures.

To make it work with the previous example (remove the previous bone structure or use a previously downloaded scene), and link the objects to each other, like so:

Cylinder 03 -> Calf Calf -> Cylinder 02

Cylinder 02 -> Thigh

Thigh -> Cylinder 01

Check that the hierarchy is now correct by pressing the Schematic (Open) button on the main toolbar, as shown in Figure 4a.

Now all you need to do is add an IK solver to this hierarchy to make it work like a robot leg. You can use your favorite IK solver, but in this example we'll use a history-independent solver. Select Cylinder 03, choose HI Solver from the IK Solver section of the Animation menu, and choose Cylinder 01. To prevent 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 selecting the HI Solver from the menu, then choose from the list Cylinder01 instead of clicking it in the viewport.

If you performed the previous tasks correctly, the result should look like Figure 4b, with the IK chain selected. If you move the IK chain, the legs should work. To make the task of animating this leg easier, you should link the IK chain to the point helper.

A point helper can be created by clicking the Point button in the Helpers section of the Create tab on the command palette, and then clicking somewhere in the viewport, as shown in Figure 4b below. In that case, I suggest you place it somewhere on the bottom of the leg. Link the IK chain to the point helper using the same selection and linking methods discussed earlier so that the legs can be animated by moving the point helper.

If your robot has complex geometry and animating individual objects would slow down your computer considerably, you can configure 3D Studio Max to display objects as bones. When using the example legs from the previous steps, you should select Cylinders 01, 02, 03, Thigh and Calf, and choose the Bone Tool from the Character menu. Enable the Bone On option in the Bone Tools dialog, as shown below.

Next, open the Display tab on the Command Palette, scroll down, and in the Link Display section enable the Show Links option and Link Replacement Objects option.

The result should appear as shown in Figure 4E.

Alternatively, you can enable only the "Show Links" option and enable the "Display as Box" option in the "Display Properties" section just above the "Link Display" section. The result should be as shown in Figure 4F.

5. Muscle

As I mentioned before, the leg used in the example above is not very realistic; it needs some muscles to make it move automatically while giving it some strength. You can make up the mechanics yourself, but you can also use one of the three main methods used in modern real-world robots:

electric motor

For the example leg above, this would be the easy way out, as you "just need" to increase the size of the knee joint and modify it as shown in photo I below, so it becomes feasible for the motor to fit inside. Also, rigging the robot is easy because you can use one of the methods we discussed earlier.

Figure 1. An industrial robotic arm driven by an electric motor.

Hydraulic/pneumatic/magnetic piston

Another common method of powering a robot is a piston. The piston (see photo II below) basically consists of a metal rod that goes into a tube. Pressurized air or oil is pumped into the piston to push out the metal rod. This is usually the sound of you being here when the robot is moving. If you want to make them realistic you should have a hose attached to it which leads to the compressor inside or above the robot. These hydraulic or pneumatic pistons are much more powerful than electric motors. Smaller pistons can use magnetism to pull or push metal rods. The latter will connect wires, not hoses.

Photo 2. The crane is powered by hydraulic pistons.

Figures 5a and 5b show our second example leg. It consists of a piston consisting of two cylinders called Piston_PA and Piston_PB. Two additional cylinders (P_Axis_A and P_Axis_B) form the axes of the piston components.

As you can see in Figure 5c below, we have assembled the legs with two bones and an IKSplineSolver. You can download the scene by clicking the link below the image.

First, we attach the parts of the piston to the legs as follows:

P_Axis_A -> thigh P_Axis_B -> calf

Piston_PA -> P_Axis_A

Piston_PB -> P_Axis_B

The leg hierarchy should now look exactly like Figure 5d.

If we bend the knee, for example with the lower aid (Point3), the two parts of the piston will not align properly and will "break", as shown in Figure 5e below.

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

To make sure the metal rod stays inside the tube we need to use a constraint, in this case a Look At constraint. As with the previous parts of this tutorial, the location of the piston part's pivot is critical to making it work. The pivots of P_Axis_A and Piston_PA are exactly at the same location, and the pivots of P_Axis_B and Piston_PB are also exactly the same. We've done this in the downloadable scene by selecting the parts that have pivots on the same axis, enabling the "Affect Pivot Only" button (see Figure 3f) and using the alignment tool (in Front, "Top" and "Left" views).

We need to add two Look Look T constraints, one for each part of the piston. Select Piston_PA, then select View from the Constraints section of the Animation menu, as shown in Figure 5f below.

Press the H key on the keyboard, select P_Axis_B, and click the Select button. Piston_PA has now changed direction. To make sure it's pointing in the original orientation, enable the "Keep Initial Offset" option in the Parameters section on the Motion tab of the command palette, as shown in Figure 5g below. (The Parameters section opens automatically when you add a View constraint.

Repeat this step for the rest of the piston, in other words: select Piston_PB, select View Constraints from the Animation menu, select P_Axis_A as the target (use the H button to select it). Also enable the "Keep Initial Offset" option again. So what we've done is make one part of the piston "see" the other part of the shaft. The direction is indicated by the blue line. If you select the auxiliary Point03 and move it again, you will see the metal bat slide neatly into the tube, as shown in the picture 5h below.

To make it realistic we need to connect pipes or hoses to a hydraulic or pneumatic piston, and we need to make sure it moves and/or bends when the legs move. There are many ways to do this, but relatively easy is to use the extended raw hose. The advantage of using the hose primitive is that you don't need to install it; no bones and no IK. Instead, we'll add two extra cylinders in addition to the hoses, and have the hoses start and end at those cylinders.

In Figure 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 entry points for hoses, such as connectors for electrical wires. You might want to use something more complex than a cylinder, but make sure it's a single object.

Next, create the hose by selecting Extend Primitives on the Create tab of the command palette, click the Hose button, and draw the hose in any viewport, as shown in Figure 5j below. Don't worry about its size, position or shape.

On the Modify tab of the Command palette, enable Bind to Object Perspective. Click the Pick Top Object button, then click the left cylinder. Click the Pick Bottom Object button, then click the right cylinder (or use the H key on your keyboard).

Depending on the orientation of the cylinder we are using to attach the hose to and the viewport you are creating the hose from, you may need 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. As you rotate the pivot, the hose flexes with it, so you can easily see when it's at the right angle.

When the hose is properly aligned with the cylinder, click on the hose again, scroll down on the Modify tab, and disable the Elastic Section Enable option as shown in the image below 5l. Also reduce the "Diameter:" value in the "Hose Shape" section to a value smaller than the cylinder.

As you can see, the hose is too long and needs to be hung tighter on the leg. You can do this by reducing the tension value (see Figure 5k). In the final image below we used 25 for both cylinders. If you use the assist to move the leg again, you will notice that the hose will stay in place, even bend if necessary. Click on one of the images to see the final animation.

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

Original link: 3ds max advanced tutorial: Create a robot model with skeletal animation (mvrlink.com)

Guess you like

Origin blog.csdn.net/ygtu2018/article/details/131767217