Jump to content

Animation Bones IK


Chris Paulson
 Share

Recommended Posts

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.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

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

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

  • 1 month later...

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.

post-648-12688626318268_thumb.jpg

post-648-12688627282773_thumb.jpg

Working on LeaFAQ :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Working on LeaFAQ :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...