I’ve tried it, it’s not that difficult.
But it took me a while because I tried much more complicated things, as I often do.
I’ve updated the example.
The girl jumped from the higher box, turned around and went to her starting position.
The input data is fixed in code.
// --- data input ---
const yRotation = 3.21;
const xPosition = -1.5;
const zPosition = 3.1;
…
function process( gltf ) {
const box = new THREE.Box3( ).setFromObject( gltf.scene );
const boxHelper = new THREE.Box3Helper( box, 0xffff00 );
scene.add( boxHelper );
const c = box.getCenter( new THREE.Vector3( ) );
const size = box.getSize( new THREE.Vector3( ) );
gltf.scene.rotation.set( 0, yRotation, 0 );
// rotate center
const cz = c.z * Math.cos( yRotation ) - c.x * Math.sin( yRotation );
const cx = c.z * Math.sin( yRotation ) + c.x * Math.cos( yRotation );
gltf.scene.position.set( xPosition - cx, size.y / 2 - c.y, zPosition - cz );
scene.add( gltf.scene );
}
There How to rotate a gltf model in a specific direction - #18 by Heyam is the last UPDATE.