Hi guys,
I’m trying to get the center point of a mesh during an animation, but so far I’m only able to get the static-mesh position (the position the animation was started in). For this project, I’m using Blender and the gltf exporter to export it to a .glb file. The animations are also created in blender and started with the Three.js AnimationMixer.
When I log the mesh of the object, the position stored in object.geometry.attributes.position does not change but returns the original position of the mesh.
var handL = this.model.getObjectByName( 'handL' ) // handL is of type SkinnedMesh
var boundingBox = handL.geometry.boundingBox;
var position = new THREE.Vector3();
position.subVectors( boundingBox.max, boundingBox.min );
position.multiplyScalar( 0.5 );
position.add( boundingBox.min );
position.applyMatrix4( handL.matrixWorld );
console.log(position)
https://stackoverflow.com/questions/14211627/three-js-how-to-get-position-of-a-mesh (the other proposed answer returned a position of (0,0,0) in my case)
Currently using Three.js version 104
Is there something that I’m missing?
Thanks,
Jurjen