Koroldev Posted September 22, 2016 Share Posted September 22, 2016 Hello! In begin I want to apologize for my English. I am using mesh.attachToBone for mount my pistol with character hand. All works fine. But when I am using bone.updateMatrix for rotate character torso var mat = this.torso.getLocalMatrix(); mat = mat.multiply(BABYLON.Matrix.RotationX(r)); this.torso.updateMatrix(mat); Torso rotates correctly, but my pistol still in place. On left screen you can see how work pistol.attachToBone, on right screen it is when I am changed torso rotation, but pistol did not move. Quote Link to comment Share on other sites More sharing options...
Koroldev Posted September 23, 2016 Author Share Posted September 23, 2016 Come on, somebody, give me a hint Maybe babylon have another way to rotate bone? Quote Link to comment Share on other sites More sharing options...
adam Posted September 23, 2016 Share Posted September 23, 2016 Here's a working example: http://www.babylonjs-playground.com/#OCCLB#17 Koroldev 1 Quote Link to comment Share on other sites More sharing options...
Koroldev Posted September 23, 2016 Author Share Posted September 23, 2016 adam, thanks, it is now all work! Just i rotated bone wrong way. Quote Link to comment Share on other sites More sharing options...
Koroldev Posted September 25, 2016 Author Share Posted September 25, 2016 I have one more question. In adam example bone rotates relatively local axis. Quote Here's a working example: http://www.babylonjs-playground.com/#OCCLB#17 How rotates bone relatively global axis. (In Space.World)? Thank! 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.