How to rotate the nodes of glTF file using three.js


#1

Am using THREE.GLTFLoader to load the glTF files in web and file is loaded and animations are working.

var loader = new THREE.GLTFLoader(manager);
loader.load(  file_path , function ( data ) { }, function ( error ) { } );

/*play animations*/
var mixer = new THREE.AnimationMixer(gltf.scene);
mixers.push(mixer);

gltf.animations.forEach((clip) => {
	for (i = 0; i < mixers.length; i++) {
		mixers[i].clipAction(clip).reset().play();
	}
});

how to rotate the nodes using three.js?

thanks in advance


#2

Crossposting:


#3

You can traverse through the scene graph via Object3D.traverse. It looks like this:

gltf.scene.traverse( function( object ) {

   // do something with your current object

} );

In this way, you can process each node and apply for example a transformation.


#4

@Mugen87 its work thank you