Viewer里面如何獲取坐標(biāo)信息?
Viewer里面如何獲取坐標(biāo)信息?
拉風(fēng)的咖菲貓
2019-01-31 21:21:34
TA貢獻(xiàn)1725條經(jīng)驗 獲得超8個贊
看你具體需求
1.獲取點擊位置(鼠標(biāo)點到構(gòu)件才會有反應(yīng))
// 綁定到h5點擊事件console.log(" >LJason< 日志:點擊位置",viewer.clientToWorld(event.offsetX,event.offsetY,false).intersectPoint);
2.獲取構(gòu)件中心點
// 下面方法拿到構(gòu)件的AABB包圍盒的兩個點,中心點算一下吧var tree = viewer.model.getData().instanceTree;var tmpBox = new Float32Array(6); tree.getNodeBox(dbId, tmpBox);var min = new THREE.Vector3(tmpBox[0], tmpBox[1], tmpBox[2]);var max = new THREE.Vector3(tmpBox[3], tmpBox[4], tmpBox[5]);
希望有用~~~好運(yùn)
舉報