可由摄像机得截头体并判断其与构件的包围盒有否碰撞来,如 var frustum = new THREE.Frustum(); var cameraViewProjectionMatrix = new THREE.Matrix4(): camera.matrixWorldInverse.getInverse( camera.matrixWorld ); cameraViewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); frustum.setFromMatrix( cameraViewProjectionMatrix ); model.getInstanceTree().enumNodeChildren(rootid, (dbid) => { var box = getComponentBoundingBox(model,dbid); if (frustum.intersectsBox(box)) dbidArrayToSelect.push(dbid) }); Viewer.select(dbidArrayToSelect) 其中getComponentBoundingBox可以参考:https://github.com/Autodesk-F...
可由摄像机得截头体并判断其与构件的包围盒有否碰撞来,如
其中
getComponentBoundingBox
可以参考:https://github.com/Autodesk-F...