Announcement

Collapse
No announcement yet.

IK nightmare

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IK nightmare

    i've not used IK chains very much, but i figured i could do this animation a lot quicker with an IK setup - oh, how wrong i was...

    as long as i kept the motion fairly simple i was fine (it's a robotic arm by the way, with 2 rotational joints and one sliding), but now the client need more details in the motion, and when i try to tweak the motion and add keys the joints is jumping/skipping all over the place. i've set up my constraints, limits, decreased thresholds, increased iterations, and done all i can think of, but nothing seems to stabilize it.

    it's been awhile since i set up the darned thing, so i'm not sure how to identify what IK solver i used, but isn't the HD solver the only one with sliding joints?

    i was hoping this was a common beginners problem and that there is some kind of remedy for it or maybe some IK rule of thumb or something, any thoughts are greatly appreciated!

  • #2
    forgot to mention that the worst flipping (180 degree) happens on the object linked to the end of the IK chain (the arm is holding a tool)
    Last edited by kimgar; 17-11-2010, 07:09 AM.

    Comment


    • #3
      Your main problem is what viewport the bones wer made in and how they're parented. If you have an object in 3dsmax with no parent at all, it's parented to the 3dsmax world instead. It's pretty much the same as having it parented to an object with a scale of 100,100,100 a position of 0,0,0 and a rotation of 0,0,0. The problem comes in when you have an object that doesn't have these nice clean rotations and scales.

      The way 3dsmax stores the position, rotation and scale of an object is as an offset of it's parent. For example, if you have a null that's at 0,0,0 position and a child object that's at 50,0,0, 3dsmax sees the child object as being 50 units away from the parent in x, 0 units in y and 0 units in z. If the parent object was at 100,0,0 and the child was still at 50,0,0, 3dsmax would see the child object as being at -50,0,0. Okay if you look at the object using world coordiates or local coordinates it'll show it 50,0,0 in world and stil 0,0,0 in local but if you set any keyframes for the object you'll see the position recorded as -50,0,0 in the trackview. Max is recording everything relative to the parent of the object. The coordinates of the child object are being added or subtracted from its parent.

      Your issue is with your rotations. What's happening is that when you start to parent different bones for your arm, when you take the first bone in your robot arm and make it the child of a null for example, it's taking the rotation of the null and then figuring out what the new rotation value for the first bone now is. Your first arm might have had a nice clean rotation value of 0,0,0 but once you parent it on to the null object, if the null has anything otehr than 0,0,0 for its rotation, your arm bone will have its rotation value changed to something different. The default rotation controller in 3dsmax has flipping issues mainly due to it having to solve the x axis, then the y axis, then the z axis and there's plenty of cases where once it's done the x and y axis, the x might be pointing in the same direction as the z. Max freaks out and everything flips all over the place. One solution is to use quaternion rotations which fixes the flipping issues but it won't give you function curves which is a pain to animate. The other option is to be really careful when you're parenting your first bone to make sure that the object it's parented to has a rotation of 0,0,0 - this way it won't pass on any nasty rotations to your bones right at the start and max will have an easier time trying to solve its rotation. Thankfully for this you can just use a simple null so it won't affect the look of your object, it just gives a much cleaner rotation to work with.

      Last thing that you can do is when you've got everything parented, select all of the objects in your hierarchy, hold down alt and right click - you'll get an optino in the top left called freeze rotation and if you choose this, it'll reset all of the rotations of the objects to 0,0,0 and hide all of the horrible offsets so that you get fewer flipping problems.

      bit of a long winded explanation but hopefully this helps!

      Comment


      • #4
        What a fantastic reply! Very well worded and very clear/easy to understand! I am going to copy and paste this for later use with some of my guys that always run into this issue. Will save me a LOT of hair pulling when trying to explain this concept over and over and over again.!

        Thanks!
        Troy Buckley | Technical Art Director
        Midwest Studios

        Comment


        • #5
          indeed! thanks a lot for your insight joconnel, it is very appreciated, i really need to nail this one, budget blown, time spent, everybody pissed - you know the drill

          i will try out your solutions first, and see if that helps. if not, i'll just have to clean things up and hope i'll get it right the other time around.

          thanks again!

          Comment


          • #6
            A sneaky way to solve a lot of these issues is for example if you've got a robotic arm like kimgar in this case, and an object that you've got to parent it to that has weird rotations, Make a point object, align it to the first bone in your robot arm so that it matches its position and rotation. Parent the first bone of the robot arm to it. Since you aligned the point to the arm first, it should match its rotation and so the difference between the arms rotation and the points rotation should be 0,0,0 - you've got a good base to start from. Now move the point and rotate it whatever way you need it to position it on your object and then parent the point to the object. If there's any messy rotation it'll happen in the rotations between the point and the object - this doesn't matter though since you're not going to animate the point. The rotation between the arm and the point should be totally clean and give you less chance of flipping.

            Comment


            • #7
              ah, very nice! in my case i think the issue was in the arm itself, there is two of them and the one causing problems was mirrored (note to self, never use shortcuts) so the axes got screwed up. rotations were clean, but a reset xform on the first bone parent seems to have stabilized the chain a lot.
              so far things seem stable, but there are many many more tools to pick up, rotate, move and leave in place, so i'm sure your trick will come in handy along the way - thanks for sharing your valuable knowledge!

              Comment

              Working...
              X