[SOLVED] How to rotate arm of skinned and rigged character

Hi… Created a character in Maya. Rigged it (Quick Rig + Skinned). Imports FBX into three.js successfully.

I need to rotate the arms by code.

I can see that the bones are already included in the import. And I can also traverse the imported object (isBone) and get the bone info (name, position, and Euler rotation). But I’m lost on how to hook this up so when I drag the gui slider it rotates a particular bone. (No problem getting value from the gui, just how this value can drive the rotation of imported rigged character)

Experimented for a few days and haven’t advanced. Maybe I don’t understand how to convert this already exiting bone and skinned character into a three.js “skeleton” for manipulating the rotation of the bones?

I know it’s straight forward to play animations imported with the fbx and skeleton, but that is not an option here. Help and guidance appreciated. bone

Maybe you can use the following fiddle for your project. It shows how to animate the arm of a glTF model in the animation loop. It actually does not matter that the model is loaded via GLTFLoader. The interesting part is the selection of the bone and the respective animation.

https://jsfiddle.net/bdmrg4oc/1/

2 Likes

@ Mugen87 Thank you! Exactly what I needed!js%20webgl%20-%20FBX%20loader%20-%20Google%20Chrome%201_2_2019%204_14_24%20PM

@Seltzer could you please share the code? its very cool.

I’ve update the fiddle from my previous post. Code works again :+1:

Thank you so much @Mugen87! Can you please add me know how we attach a TransformControls to that right arm? I just want to move it up and down in one direction.

You do it exactly like in the official example: Edit fiddle - JSFiddle - Code Playground

1 Like

Amazing @Mugen87! Thank you so much!

Along the same lines, @Mugen87, I was looking at the following example https://rawgit.com/takahirox/three.js/GLTFMMD/examples/webgl_loader_gltf_miku_ik.html

How can I enable a TransformControls marker to move the bones with respect to the position? Using the same technique, is it possible move the soldier limbs?