Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

An Introduction to CCD IK and how to use it

Discussion in 'Animation' started by JamesB, Jun 21, 2018.

  1. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    112
    Hello all,
    I recently did a talk about the CCD algorithm for IK and how to use the Animation Jobs system to implement it. Here are the slides for my Unite talk:
    https://oc.unity3d.com/index.php/s/WDLkaj3S9rGYCH7
    And here is the project:
    https://oc.unity3d.com/index.php/s/IR6aKCQjQrrx4uW
    Please note that this project was made using the 2018.2 beta and that Animation Jobs are part of an Experimental namespace. They are subject to change but I might not have time to update the project to match those changes, though I will do my best. Also note, this is not a complete solution for all things IK, just an introduction to the algorithm and how to use it. You will need to finish the implementation yourself in order that it is useful in a game.
     
    iike, CodeKiwi, saad-kh and 1 other person like this.
  2. Ice_MJ

    Ice_MJ

    Joined:
    Jul 26, 2016
    Posts:
    15
    Thx a lot!
     
  3. Automoda

    Automoda

    Joined:
    Apr 27, 2017
    Posts:
    137
    Is there a video up?
     
  4. Ice_MJ

    Ice_MJ

    Joined:
    Jul 26, 2016
    Posts:
    15
    You can get the video at youtube. Here is the link
     
  5. dev01

    dev01

    Joined:
    May 3, 2010
    Posts:
    20
    I was wondering if there was a solution for ccdik uses in “prone animations”? Unreal engine has a solution to follow the normals of the terrain during movement in prone but Unity currently does not. Can ccdik be a solution for this and if possible can you post a script using it or video for a “prone crawl forward” on uneven ground. It’s a lot to ask but I have scoured the Internet for months and have no solution. Thanks in advance
    Great presentation by the way!
     
  6. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    112
    @dev01 This solution for IK is only positional in that it doesn't have target rotations. This CCD algorithm is not ideal for what you are looking for. I don't know of an algorithm off the top of my head which would fill your needs perfectly but I'd imagine there are papers and tutorials out there which should help you write an algorithm which would work. I've had a few ideas for one I've been meaning to write myself but I haven't had the time! If I get around to it eventually, I'll do another talk like this one but I'm afraid that might be a bit too late for you.

    Sorry I couldn't be more helpful.
     
  7. discofhc

    discofhc

    Joined:
    Dec 18, 2017
    Posts:
    41
    Hi!
    How this relates to the "Animation Rigging" package announced at this year´s GDC talk?
    Any chance to CCD IK be implemented in the package?
    Thanks!
     
  8. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    112
    @discofhc At the time of recording this was unrelated to Animation Rigging. However, I there is currently a branch of the Animation Rigging package with this algorithm in and I am hoping it will be merged with the master branch. If so you will be able to use this algorithm as part of the Animation Rigging package. However, the team's priority is to make sure what they have works and not to add additional rig constraints. As such it's unclear whether or not this will be added any time soon - it might, it might not. Sorry I can't be more specific.
     
  9. obucklin

    obucklin

    Joined:
    Mar 22, 2018
    Posts:
    1
    @JamesB Thanks for the great talk! I'm interested in implementing CCD for implementation with physical robots. I have a working IK script with positional control and joint limits, but I would really like to solve for end-effector(EE) orientation as well. I have found various academic articles on the subject, some of which mention EE orientation, but not how to solve for it, and at least one source which says it isn't possible. Do you have any idea how that could be implemented in the CCD algorithm? Another option is obviouly a traditional Jacobian Transpose IK solver, but given the simplicity of CCD, I would love to benchmark the two. Thanks!
     
  10. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    112
    @obucklin I don't have any experience on writing IK algorithms for physical robots so I cannot really speak with any authority on this. It is possible that a variation of the CCD algorithm would work when each bone is only rotated in the axis it can be rotated (rather than the free rotation I used in the talk). The problem with this is that it doesn't guarantee a solution and so you will need many more checks to verify that the algorithm isn't continuing indefinitely. It's possible that a FABRIK solver might be better for this situation - I'm not sure.