Chris Paulson Posted January 19, 2010 Author Share Posted January 19, 2010 I've now got the IK working as long as the model is not rotated. Just need to handle rotations now. Quote Link to comment Share on other sites More sharing options...
Josh Posted January 19, 2010 Share Posted January 19, 2010 I'd be very interested to see a compiled example. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Chris Paulson Posted January 19, 2010 Author Share Posted January 19, 2010 True, but for a: - hip, knee, ankle, toe you are solving mutiple rotations which is where it gets tricky (for me at least). Hopefully in a couple of days I'll have it working and I'll post all the code. Quote Link to comment Share on other sites More sharing options...
flachdrache Posted January 19, 2010 Share Posted January 19, 2010 I knew quaternions once. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
TylerH Posted January 20, 2010 Share Posted January 20, 2010 I lost track of this thread. There are helper functions that convert Quats to Euler Angles, among other things. I did not implement conversions because that is up to the end user. Internally it makes calls to STL math functions that take radians, however, the actual parameters a Quat stores aren't Euler Angles in either degree or radian form, so the difference wouldn't exit. The only time you need to deal with Rad/Deg conversion is with the Euler Angles To/From. Glad to hear you got it working. I haven't been very involved lately due to some school stuff. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Canardia Posted January 20, 2010 Share Posted January 20, 2010 I read this on the Raydium website (a great engine to learn how to write engines btw), and I kinda understood for the first time how to use quaternions: 2.27 void raydium_math_quaternion_multiply(float *q1, float *q2, float *result):Multiply two quaternions and fill the result with the resulting quaternion. Quite usefull for making rotations over quaternions. Here a list of common quaternions: W X Y Z 1,0,0,0 Identity quaternion, no rotation 0,1,0,0 180' turn around X axis 0,0,1,0 180' turn around Y axis 0,0,0,1 180' turn around Z axis sqrt(0.5),sqrt(0.5),0,0 90' rotation around X axis sqrt(0.5),0,sqrt(0.5),0 90' rotation around Y axis sqrt(0.5),0,0,sqrt(0.5) 90' rotation around Z axis sqrt(0.5),-sqrt(0.5),0,0 -90' rotation around X axis sqrt(0.5),0,-sqrt(0.5),0 -90' rotation around Y axis sqrt(0.5),0,0,-sqrt(0.5) -90' rotation around Z axis TODO: Those could be added like defines Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
TylerH Posted January 21, 2010 Share Posted January 21, 2010 They are more complex than that, since the W component can be imaginary. The beauty of quaternions is: x^2 == y^2 == z^2 == x*y*z == -1 Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Chris Paulson Posted January 21, 2010 Author Share Posted January 21, 2010 Well last night I got it working. I need to improve the joint constraints and pick the spaghetti out of my code and I'll post it. Watch this space. Quote Link to comment Share on other sites More sharing options...
Chris Paulson Posted January 23, 2010 Author Share Posted January 23, 2010 Hi, I've updating my blog with a video of the IK and the source code. Enjoy... Blog: - http://leadwerks.com/werkspace/index.php?app=blog&module=display§ion=blog&blogid=19 Quote Link to comment Share on other sites More sharing options...
Niosop Posted January 23, 2010 Share Posted January 23, 2010 Awesome job Chris! Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
VeTaL Posted March 17, 2010 Share Posted March 17, 2010 Okay, i worked around your IK (great, Chris), but i want to know discuss some details. I see, that on the ground it works perfect, as on 1st picture... But on the not-plane surface, looking like IK ignores its shape. On the left picture, it works good, but on the right - ignores surface. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Chris Paulson Posted March 18, 2010 Author Share Posted March 18, 2010 Good job at getting my code working so far. The IK stuff needs at lot more work on it to get it working. It needs to the following: - predict the next foot placement do a line pick on it Work out a height to place model/hips IK adjust both feet to meet correct floor height (determined by line pick) I halted work on IK stuff to get the blend tree code working, as this would effect the next foot placement. The first picture is showing a bug as it says the stance is "unknown", I have already fixed this bug in the animation analysis code. I really didn't think you'd get your head around my code so fast, amazing. Quote Link to comment Share on other sites More sharing options...
VeTaL Posted March 18, 2010 Share Posted March 18, 2010 Thanks, it wasn't good time to cut it from recast and so on Anyway, i just launched your code, i still dont know, how 70% of it works, but i'm going to manage with it. Also, i'm going to search more info about IK: i have a thought that your dividing to cycles is a bit too complicated. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Chris Paulson Posted March 18, 2010 Author Share Posted March 18, 2010 The dividing into cycles is simple compared the usual stuff. Have a look a aigamedev web site etc. They use complicated maths such as point clouds and interpolation, my project is much simpler. Also read rune's thesis. Quote Link to comment Share on other sites More sharing options...
VeTaL Posted March 19, 2010 Share Posted March 19, 2010 http://grail.cs.washington.edu/projects/styleik/ Smooth intepolation between three walking styles Interesting video, but there is no comments, how it is done... Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted March 22, 2010 Share Posted March 22, 2010 Hey, i have an idea... Maybe we can take the "next" frame and apply forces to the current joints to move them? I still dont know, how your code works 100%, so maybe this idea would be a little stupid, but i just wanted to share it. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.