I guess this has to be a problem with how you set the OrbitControls target. Code for that would be good to see
Also Box3().setFromObject( o ) will take every object, even when invisible, into account. I would try to make everything visible and/or draw a box for the boundbingbox of each object to see if there is any obj that is not positioned correctly and is overlapping
object.traverse(o => {
o.visible = true
o.updateMatrix()
if(o.geometry) {
o.computeBoundingBox()
let size = new THREE.Vector3()
o.boundingBox.getSize(size)
let g = new THREE.BoxGeometry(size.x, size.y, size.z)
let b = new THREE.Mesh(b, new THREE.MeshBasicMaterial({ transparent: true, opacity: .5 })
scene.add(b)
}
})
onComplete: function () {
var box = new THREE.Box3().setFromObject( obj );
box.getCenter( obj.position ); // this re-sets the obj position
obj.geometry.center();
}
})
The selected part node is centered .
Like this effect:
But with this centring, the part node is out of the model, and I don’t want to center to change the local position of the part node.
I want to center the selected model node without changing the local position of the part node.
Move the model position as a whole? Continue adjusting the camera? or ?
sorry for the late reply. This looks like your animation has the worng target point and as soon as the animation is done, its set correctly? Can you show some code?
BTW If you want to find out the world coordinates of a child model, you can use obj.getWorldPosition(vec3)