shen Posted February 12, 2017 Share Posted February 12, 2017 In Babylonejs, BoneIKController assumes that all bones are oriented along the x-axis, like the Dude example http://www.babylonjs-playground.com/#1EVNNB#15. I find that "The bones should be oriented along the y-axis". Here is the demo of using BoneIKController with y-axis http://www.babylonjs-playground.com/#1EVNNB#46. To make it work correctly, you need to change BABYLON.Matrix.RotationYawPitchRollToRef(0, 0, Math.PI * .5, mat2); to BABYLON.Matrix.RotationYawPitchRollToRef(0, 0, 0, mat2); in babylon.boneIKController.ts file. Of course, we can't expect that not all bones follow the same convention. So I wonder Will it be solved by adding {adjustYaw, adjustPitch, adjustRoll} option like BoneLookController? Is it possible to detect the bone orientation automatically? Or we just add bone orientation parameter to BoneIKController. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 13, 2017 Share Posted February 13, 2017 Ping @adam Quote Link to comment Share on other sites More sharing options...
adam Posted February 13, 2017 Share Posted February 13, 2017 On 2/12/2017 at 7:40 AM, shen said: In Babylonejs, BoneIKController assumes that all bones are oriented along the x-axis, like the Dude example http://www.babylonjs-playground.com/#1EVNNB#15. Here is a demo with a simple model that was created in Blender that has bones oriented along the y-axis: http://www.babylonjs-playground.com/#PNJGW#7 Please post an example that demonstrates the issue you're having. You might just need to change the bendAxis. In this example, the second bone is bending on the z axis: http://www.babylonjs-playground.com/#PNJGW#6 I might need to improve the way the default bend axis is set if it isn't set by the user. https://github.com/BabylonJS/Babylon.js/blob/master/src/Bones/babylon.boneIKController.ts#L58 Quote Link to comment Share on other sites More sharing options...
shen Posted February 14, 2017 Author Share Posted February 14, 2017 I might not describe it clearly. I'm talking about how to make the bone point to the target (no the default bend axis). For your 2 examples, y-axis always point to the target mesh (with or without bendAxis option), seems because BoneIKController._rightHandedSystem is false. For my example http://www.babylonjs-playground.com/#1EVNNB%2346 and the dude demo http://www.babylonjs-playground.com/#1EVNNB%2315 (both _rightHandedSystem = true), x-axis always point to the target mesh. I can make them work with y-axis by setting BoneIKController._rightHandedSystem to false (It will cause another problem with bending). Is it Babylonjs' problem or the meshes' error? Quote Link to comment Share on other sites More sharing options...
adam Posted February 14, 2017 Share Posted February 14, 2017 Thanks for providing the example. I think I can come up with a fix for this. Quote Link to comment Share on other sites More sharing options...
adam Posted February 14, 2017 Share Posted February 14, 2017 Thanks for reporting the bug. I just submitted a PR. Quote Link to comment Share on other sites More sharing options...
adam Posted February 15, 2017 Share Posted February 15, 2017 http://www.babylonjs-playground.com/#1EVNNB#52 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
wemustact Posted December 21, 2019 Share Posted December 21, 2019 Hi, Adam, shen, I found current version(4.1.0-beta.18) still has the problem.When use 'dummy3' mesh and control it's left fore arm with IK, it will not pointing to the target.But it goes well with right fore arm which is x-asix oriented originally. Quote 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.