renjianfeng Posted September 5, 2018 Share Posted September 5, 2018 It's like selecting multiple bones in blender and then adjusting the overall position and rotation。 Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted September 5, 2018 Author Share Posted September 5, 2018 sm10.glbThis is the GLB file,You can get bones in the following way scene.getBoneByName("Kości medyk_Head").rotate(BABYLON.Axis.Y, Math.sin(t) * Math.PI); scene.getBoneByName("Kości medyk_L Arm").setAxisAngle(BABYLON.Axis.Y, Math.sin(t) * Math.PI); scene.getBoneByName("Kości medyk_R Arm").setAxisAngle(BABYLON.Axis.Y, Math.sin(t) * Math.PI); scene.getBoneByName("Kości medyk_Bone").setAxisAngle(BABYLON.Axis.Y, Math.sin(t) * Math.PI); Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted September 5, 2018 Author Share Posted September 5, 2018 This is blend file: Sm3.blend Quote Link to comment Share on other sites More sharing options...
PatrickRyan Posted September 10, 2018 Share Posted September 10, 2018 @renjianfeng are you sharing out your method for the community or did you have a question about the topic? Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted September 11, 2018 Author Share Posted September 11, 2018 11 hours ago, PatrickRyan said: @renjianfeng are you sharing out your method for the community or did you have a question about the topic? I do have some questions, I would like to get how to control bones in this way in babylonjs. Quote Link to comment Share on other sites More sharing options...
Raggar Posted September 11, 2018 Share Posted September 11, 2018 Why not do it in blender, since you already have the file on hand? All you have to do is create a new bone without any vertices/weights assigned to it and place it right where your pivot should be(right above your Body bone). You link the head, arms and gun bones to this bone, and then link this bone to the Body bone. Then the skeleton will behave as before, while giving you the opportunity to transform the upper body using one control point. If it Has to be done in BabylonJs, then that is possible as well by creating a new bone, and doing the same thing as discussed above: https://doc.babylonjs.com/api/classes/babylon.bone#constructor Quote Link to comment Share on other sites More sharing options...
PatrickRyan Posted September 17, 2018 Share Posted September 17, 2018 I agree with @Raggar that the easiest way to create your skeleton hierarchy is in a DCC application. If you are thinking of doing something like swapping meshes like changing the gun on your character, the easiest way would be to instantiate the mesh in the correction position and then parent it to the bone that should control it like the hand. That way your mesh will animate with the hand of the character and can be changed at runtime. For any skeleton hierarchy created in Babylon.js or in a DCC app, rotating a joint will affect all children of that joint. You could assign quaternion animation to the bone you want to animate ( https://doc.babylonjs.com/features/animations ), but it is much easier and faster to animate in your DCC package and call the animation you need. ( http://doc.babylonjs.com/how_to/group ) Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted September 20, 2018 Author Share Posted September 20, 2018 Thanks,That's great advice. I have solved this problem through the Group Animations. 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.