Raggar Posted March 20, 2017 Share Posted March 20, 2017 I was wondering if it's possible, and if yes, then how, to get more responsive movement when using getPositionToRef to attach a mesh to a bone assigned to some skeleton from an imported model. I think it's the same when using attachToBone. http://www.babylonjs-playground.com/#1N9CSW#2 The position and rotation of bone #6 (right hand) is used to position the sphere. Imagine it was a sword or a gun. Try moving the camera around, and notice the movement of the sphere. It seems to be a little behind, and not as crisp as one would have hoped for. Am I missing something here? Quote Link to comment Share on other sites More sharing options...
adam Posted March 21, 2017 Share Posted March 21, 2017 It appears to me that you might have some skeleton issues. http://www.babylonjs-playground.com/#1N9CSW#5 http://www.babylonjs-playground.com/#1N9CSW#4 Quote Link to comment Share on other sites More sharing options...
adam Posted March 21, 2017 Share Posted March 21, 2017 This is an issue with parenting the mesh to the camera. http://www.babylonjs-playground.com/#1BZJVJ#92 http://www.babylonjs-playground.com/#1BZJVJ#96 edit: also occurs when parenting to a mesh (skeletonViewer lags): http://www.babylonjs-playground.com/#1BZJVJ#93 attachToBone doesn't look bad though: http://www.babylonjs-playground.com/#1BZJVJ#94 http://www.babylonjs-playground.com/#1BZJVJ#95 For now you should use attachToBone. edit 2: I got it to work by computing the world matrix of the mesh before getting the position or the bone: http://www.babylonjs-playground.com/#1N9CSW#6 I'll submit a PR to fix this issue sometime this week. Raggar and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Raggar Posted March 21, 2017 Author Share Posted March 21, 2017 4 hours ago, adam said: It appears to me that you might have some skeleton issues. I'm wondering whether this might be because I'm using dummy objects instead of the standart bones in Max. I'll recreate the skeleton using bones and see if that fixes the issue. 4 hours ago, adam said: I got it to work by computing the world matrix of the mesh before getting the position or the bone: http://www.babylonjs-playground.com/#1N9CSW#6 I'll submit a PR to fix this issue sometime this week. Awesome. Looks much better. Thank you, once again Quote Link to comment Share on other sites More sharing options...
Raggar Posted March 21, 2017 Author Share Posted March 21, 2017 It was indeed the skeleton. I made a quick test with a new skeleton (using bones), and the skeleton is alligned perfectly: http://www.babylonjs-playground.com/#1N9CSW#14 Wingnut and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 21, 2017 Share Posted March 21, 2017 Perfect 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.