d3-force-graph icon indicating copy to clipboard operation
d3-force-graph copied to clipboard

关于节点拾取的疑问

Open vellengs opened this issue 5 years ago • 0 comments

threshold 固定值无法精准适配 scale 节点大小的问题。

   let ray = new THREE.Raycaster()
    ray.setFromCamera(normalMouse, this.camera)
    ray.params.Points.threshold = 2 // 对于不同的scale 这个固定的值会导致无法像碰撞检测那样精准的拾取,有无更好的方案?
    let intersects = ray.intersectObjects(this.scene.children).filter(e => e.object.type === 
   'Points' && !e.object.name.startsWith('hl'))

vellengs avatar Dec 14 '19 02:12 vellengs