An approach to Inverse Kinematics
Blitz3D Forums/Blitz3D Programming/An approach to Inverse Kinematics
| ||
http://www.cs.vassar.edu/~ellman/old-courses/395-spring-2001/cs395-lecture12.pdf Realtime Inverse Kinematics, how cool would it be ? Imagine moving a bone joint of the hand of your model, and have the arm perfectly bending or relaxing. Aaaah :) Man, that is the kind of lecture I've been searching for the past 2 days. Now, got the theory and the formulas, I'm wondering, anybody went in this matter already ? I heard someone is trying to do that for animated .b3d The fact about this, is that, a 3D artist, who works in Max or Maya, would like to see its Effectors / IK Handle implemented, and not an external editor for it. So the real best would be maya/max---->b3d + IK, and IK calculated on the basis on what the SCENE have in its format. This would allow kick-ass / straigh-forward implementation of characters. Let's see if we can come up with something (at least, simulating IK from given value, and not read from a LWO/max/maya scene) |
| ||
Page not found. |
| ||
I find the page... |
| ||
I got it. Having redefined the process of 3D architectural modeling, I may turn my attention to a real-time IK animator and physics system. |
| ||
"Having redefined the process of 3D architectural modeling, I may turn my attention to a real-time IK animator and physics system." if anyone can do this, you can :) |
| ||
ok, get your hand out of his pants! =] |
| ||
Is too much math for me :) But If I'm too bored I will try perhaps :P |
| ||
"ok, get your hand out of his pants! =] " it's just halo seems to be one of the best coders(there's some others too) around here especially with the advanced stuff. |
| ||
I almost typed that without laughing. Almost. |
| ||
Here is a little snippet of code I did as an expression in Maya. It's a 2D analytical IK. I'm no expert coder nor good at maths, but I at least got this working. (for those not familiar with Maya, e.g. Handle.translateX simply refers to the position of handle geometry/null in X and so on). float $t; float $a1; // angle of first bone float $a2; // angle of second bone float $L1=5; // length of first bone float $L2=3; // length of second bone $t=rad_to_deg(acos(Handle.translateX/(sqrt(Handle.translateX*Handle.translateX + Handle.translateY*Handle.translateY)))); $a1 = rad_to_deg(acos(($L1*$L1 + Handle.translateX*Handle.translateX + Handle.translateY*Handle.translateY - $L2*$L2) / (2*$L1*(sqrt(Handle.translateX*Handle.translateX + Handle.translateY*Handle.translateY)))) ); $a2 = rad_to_deg(acos(($L1*$L1 + $L2*$L2 - (Handle.translateX*Handle.translateX + Handle.translateY*Handle.translateY)) / (2*$L1*$L2)) ); Bone1.rotateZ=$a1; Bone2.rotateZ=(180-$a2)*(-1); Ragnar p.s. Now what was it one enclosed code in here? |
| ||
humm, in a 3 axis system would be ? :) I think the answers[formulas] are on that PDS paper I posted, pity they are written in math language, not in a programming language. Maybe some student in math can help here. |
| ||
Hehe...if you want the details on this, I used a book called Computer Animation Algorithms and Techniques by Rick Parent. It's an excellent (somewhat expensive) book, that explains in detail how the formula works, including 3 axis. Here is an explanation of the stuff above, shown step by step. Hope that's of some help. In Maya I simply added an aim constraint to the parent of the bones, thus I got three axis...maybe the same could be done in Blitz. Ragnar |
| ||
Aren't used IKhandle, Locators and other kind of things in Maya ? Anyway, thanks I will look into this picture. You can remove it now if you want, I have got it. BTW, very similiar to the formulas in the PDS papers. I wonder how long it will take to translate into blitzMath code. :P |