Lucas_Lua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7521 |
|
|
| 18 May 2016 10:47 AM |
For those who don't know, inverse kinematics is the process of doing the opposite of kinematics. Kinematics is finding the end position or target of a set of joints using their angles. Inverse Kinematics is finding the angles of the same set of joints given the end position or target.
I'm trying to do this with welds, but I can't wrap my mind around how to calculate the new end position without actually changing the welds. Its like I've completely forgotten how CFrame works. Any help?
I put a part where I want a model to rotate on (like a leg or foreleg) and then weld all the model pieces to that joint part. Then I weld the joint part to its "parent joint" such as the hip or torso. This is in such a way that the Torso is the top of the joint hierarchy, and the angles of the joints are all at 0 degrees (the legs being completely straight). There's a joint for the hip, knee and foot parts, at their expected anatomical positions.
For example, rotating the hip by 5 degrees will rotate the entire structure by 5 degrees. Rotating the knee joint by 5 degrees will rotate everything from the knee down by 5 degrees.
So for calculating the end point, could I start at the top of the hierarchy for a particular joint structure and work my way down, multiplying a CFrame value by whatever the current CFrame of the weld is plus the new angle? |
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 18 May 2016 11:07 AM |
I would suggest getting the length of the structure (Lets just say as an example, from hip joint down to knee joint, and "toes". So the total length) then, see if u rotate it and it happens to appear to be either past or not at the target then see what happens when u rotate the hip joint. <- just an example. I can't think of how to do the math right now as am sleep deprived, but as soon as I get some memory back I'll post. |
|
|
| Report Abuse |
|
|
ElectroTM
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 1135 |
|
| |
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 18 May 2016 11:38 AM |
| http://wiki.roblox.com/index.php?title=Inverse_kinematics |
|
|
| Report Abuse |
|
|
Lucas_Lua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7521 |
|
|
| 18 May 2016 12:30 PM |
| That is exactly what I needed! Thanks! I had no idea the wiki had an article about this. |
|
|
| Report Abuse |
|
|