inverse kinematics

New releases and general discussions.

Post » Thu Jan 15, 2009 1:42 pm

I was just thinking about "inverse kinematics" movement addon.
For now we can make that kind of effect only by hinges or events, but both of them needs many line of code.
Ie. for arm you have: Upper Arm, Lower Arm and Hand (and fingers for hardcore creators) and you need to set them up by many event. Only bone movement behavior (which is really amazing) allow to do it in simple way but only in editor and not in runtime. I'm sure that's not that hard to make as a sepreate behavior or even better as bone movement addition. Just select "parent" and "children" sprites and that's it. Link between them will allow you to move whole arm (in proper way) by dragging the hand only.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Thu Jan 15, 2009 9:45 pm

i can do a 2 arm IK with 3 events, but it can even use 1.

its 100% accurate

you could probably make a behaviour with my method (this is for the devs)
my method should accomodate any arm length. Although its not working for me atm it can only work with equal length arms. no reason why it shouldnt, its a problem in my actions.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Jan 16, 2009 10:33 am

yes you are right, but what if you need more than 2? You could just setup IK in editor between as many arms as you need and drag it in runtime without any events.

btw. can you post your *.cap file? just curious what kind of ik system you have
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Jan 16, 2009 12:47 pm

well, you have to realise when you have only 3 arms, things get really complicated and instead of 2 possible solutions youll get 300 solutions, because the arms will have lots of range of motion.
if you want more than 2 arms on an ik, just make a seperate one for each task, youll have way more control like that anyways. i can probably make a faux 3 arm, but it wont choose the optimal solution, itll bend more like a finger does.

heres the cap for my 2 arm, it uses a trignometry to work

http://willhostforfood.com/files3/6035270/RealIK.cap
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Jan 16, 2009 1:17 pm

must admit, IK is perfect :)
...but only if you can understand things like:
"Set Angle to global('AC')+acos((B.Width^2+global('C')^2-A.width^2)/(2*B.width*global('C')))" - i can't to be honest (and probably most of new users) :/.
I was thinking rather of doing the same thing you did but in extreamly easy way. The same way is with bone movement - you can do some crazy event or you can just open bone editor and make it work like you want in very easy way. That's my point :)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Jan 16, 2009 9:38 pm

it may seem complex, but all you need to do is change the parameters around to suit your needs
it uses this method to solve the ik.

it uses the cosine rule, explained well here
http://www.teacherschoice.com.au/Maths_ ... ig_SSS.htm
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sat Jan 17, 2009 12:24 am

ill post a better example in uploads, my technique is simple to use, and i bet a dev is gonna turn it into a behaviour.

my average computer runs this IK very easily
it can handle 370 constantly solving chains, without dropping below 60 fps. thats very efficient
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sat Jan 17, 2009 9:04 am

nothing more to say... :D
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sun Jan 18, 2009 4:29 am

[quote="shinkan":2d6kfmy5]must admit, IK is perfect :)
...but only if you can understand things like:
"Set Angle to global('AC')+acos((B.Width^2+global('C')^2-A.width^2)/(2*B.width*global('C')))" [/quote:2d6kfmy5]

As a rule, I don't think Quazi posts anything that's readable to humans.
B
3
S
2
G
4
Posts: 271
Reputation: 2,017


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests