【发布时间】:2020-06-07 15:22:04
【问题描述】:
当用户单击 dbId 时,我正在绘制一个标签,因为我使用下面的函数来查找坐标,但它给了我一些错误的坐标而不是正确的坐标。例如,要让 x 坐标接近 400,我只能得到 12.85。
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;
}
【问题讨论】:
标签: autodesk-forge autodesk-viewer autodesk-model-derivative autodesk-data-management