I am plotting a label when user clicks on a dbId, for that I use below function to find coordinates but it gives me back some wrong coordinates instead proper ones. for example to get x coordinate as somewhere near 400, am getting 12.85 only.
function getObjPosition(dbId) {
const model = viewer.model;
const instanceTree = model.getData().instanceTree;
const fragList = model.getFragmentList();
let bounds = new THREE.Box3();
instanceTree.enumNodeFragments( dbId, ( fragId ) => {
let box = new THREE.Box3();
fragList.getWorldBounds( fragId, box );
bounds.union( box );
}, true );
const position = bounds.center();
return position;
}