Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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 ■

Posted

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

  • 1 month later...
Posted

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 :)

Posted

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.

Posted

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 :)

Posted

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.

Posted

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.

Working on LeaFAQ :)

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.

×
×
  • Create New...