Inverse kinematics in games




















My question is: is there any reason why those libraries shouldn't be used for virtual animation "gaming" Are they generally slower or something?

Probably nobody knows, but I thought I'd ask anyway. I found this for example. Give it a try. I assume those libraries do much more than necessary, at least for my needs. But if you can figure out how to use it in reasonable time, why not? The processing power is no issue.

My walking ragdoll is not much slower than a regular dead ragdoll - but i need to run the entire physics with at least 90 Hz. The Newton physics engine is very accurate and stable so i don't need tiny timesteps or many sub iterations like research projects do.

Also i don't need to use a custom torque solver for the joints, i just use out of the box functionality. My math background is the absolute minimum, just self taught. IK Solvers kept me sparetime-busy for three weeks or so. Doing a controller for a physical simulation is hard, but for animation you may eventually overestimate the problem.

Log In. Sign Up. Remember me. Forgot password? Don't have a GameDev. Sign up. Email Address. Careers Careers. Learn about game development. Follow Us. Chat in the GameDev. Back to Math and Physics. Inverse Kinematics with Joint Limits. Math and Physics Programming.

Max Power Cancel Save. JoeJ This stuff tends to produce unexpected results and it's easier to fix this in self written code. How hard this becomes depends mostly on the complexity of behaviour you need. Keep this at a minimum, you can not expect to create an intelligent virtual living thing without making it a lifetime project ; The strategy i use is something like this: It's advancing in small timesteps, so no need to calculate a exact final solution, just come a bit closer to the target.

Eventually recursively repeat this through the entire skeleton, but do you really need to? Sign up. Email Address. Careers Careers. Learn about game development. Follow Us. Chat in the GameDev. Back to For Beginners. Inverse kinematics. For Beginners. Started by jor July 22, PM. Hi, i would like to find a good document about inverse kinematics in game, i am going to start a soccer game with a friend and i would like to learn all the things about inverse kinematics that i will need to create my soccer game.

Any of you could recommend me an article or book which explains this for beginners? Cancel Save. Palidine Implementing IK is more or less a pretty advanced technique. With deformation, individual control points on the geometry are moved in relation to the bones and joints. This is a marked improvement over moving an entire piece of geometry at once. There are still benefits to using Forward Kinematics on some parts of your skeleton. Some packages allow the use of both Forward and Inverse Kinematics on the same skeletal chain and even allow you to switch between them on the fly.

Others allow you to switch only with great effort on your part. To do this, you usually have to employ constraints think of constraints as magnetic forces that can be keyframed on and off , expressions mathematical formulas , or a combination of both. Skeletons are neither represented nor controlled the same way in every application.

Figure 5. When bones share control over a surface, very smooth tucks and bends are possible. Some packages, while offering an Inverse Kinematics system, do not provide bones at all. Instead, you build your own skeleton out of primitive objects or assign skeletal properties to individual parts of each character. This technique is commonly used in Softimage 3D for things like muscle bulges and chest expansion. See Figure 6. Figure 6.

Translation, rotation and scaling of the null will affect the position and bulging of the muscle and can easily be tied to elbow rotation through expressions. The black box in the schematic to the left shows the arm geometry as the parent of this family.

Note that in Softimage 3D, joints are selectable objects, and bones are not. Individual bones are built with their own set of local axes, usually but not always X, Y and Z.

As with geometry, the placement and orientation of these axes determine the pivot point of the bone as well as its rotation direction. Generally bones can be thought of as two pieces welded together-the bone itself and the joint that allows the bone to rotate. Softimage XSI and 3D, for example, refer to the entire bone segment as a joint. Flexors can facilitate realistic creasing, such as on the inside the elbow a good candidate for joint positioning , and muscle bulging the flexor positioned along the bone.

In Softimage 3D, the X-axis always faces down the length of the bone. Other packages, like Maya, allow you to choose the orientation of your center. Why does it matter which way the pivots are oriented?

With most setups, that axis is Z. This makes creating expressions a snap. Hold your hand out in front of you with your palm facing up. Watch your forearm. Now, without moving your shoulder, rotate your hand until your thumb points at the ceiling. That not-so-subtle twist you see between wrist and elbow would be impossible or at least very painful if your forearm rotated as one solid piece.

Notice that the flesh closer to your hand rotates right along with your wrist joint, but that the effect falls off toward your elbow. With surface deformation, each control point on the overlaid geometry is controlled by the nearest joint s or bone s. This means that characters no longer need be loose piles of rock-hard segments. Elbows can bend naturally; the biceps can even bulge and flatten. See Figure 5. Your problems are over, right? Well, not exactly. The bad news is that an IK system is not always more intuitive than Forward Kinematics.

The setup takes some time to understand. Look at your own joints. Think of the various ways your joints work. Your elbows and knees move differently than the joints in your shoulders and hips, which work a little differently from each other, and all are different from the vertebrae in your back and neck. Generally, animation packages give you one or two types of bones with which to work. They also provide a few different options for controlling the bones.

Although we humans have several hundred bones supporting our feet, legs, hands and organs, there is rarely a need to match our internal skeleton bone for bone when building a CG skeleton.

That method is often counterproductive from an animation standpoint: having too many bones fighting for control of your surface is like having too many cooks in the kitchen. Use the fewest number of bones possible. Again, this is meant to be believable, not real. To be convincing, you need two kinds of joints: ones that can swing all the way around in the socket which is really more than any of yours do without excruciating pain , and joints that only bend in one direction, like your elbow.

Softimage 3D handles this by giving the first root joint of every skeletal chain the ability to spin freely on all axes, more or less imitating a ball-and-socket joint. What if you have to use more than two links at a time?

Two links are fairly straightforward in a chain controlled by IK, but the foot represents a third link. How do you deal with adding feet? In Softimage 3D, the ankle is really two things: the end of the leg chain and the start of the foot chain.

Strictly speaking, a chain controlled by IK is controlled by the bottommost link or joint of the chain. Any movement of that bottom joint, or end-effector, rotates every bone to some degree all the way up to the top of the hierarchy. Consider a chain with two leg bones thigh and calf where the ankle is t he bottom joint and end-effector. Pushing the ankle straight up results in a bending of the knee and a rotation of the thigh at the hip, a fairly straightforward motion. That same push, this time with the end-effector on the ball of the foot, now results in an ankle bend, a knee bend and a rotation of the thigh at the hip.

But the order in which each joint bends and the amount each rotates will vary greatly with only slight adjustments, making this setup difficult to control. See Figure 7. Figure 7. This setup gives you an end-effector on the ankle and another on the toe.



0コメント

  • 1000 / 1000