vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
2.03k stars 301 forks source link

[Bug?] Path obj can't click with stroke #25

Closed lslzl3000 closed 3 years ago

lslzl3000 commented 3 years ago

Describe the bug with .pathStroke(), the path line will not able to interact with mouse event, looks like raycaster will not catch the obj.

To Reproduce Steps to reproduce the behavior:

  1. A live demo on codepan
  2. Click on any line, they can be clicked, alert shows
  3. uncomment line 30 .pathStroke(2)
  4. then they can't be clicked or any mouse event

Expected behavior with skroke value, path lines should able be clicked

Additional context hope someone could dig animation with stroke

lslzl3000 commented 3 years ago

@vasturiano Looks like there is no raycast method for LineSegments2 before THREE r112. Now, the official example added raycast, so you can update the flatline code https://github.com/mrdoob/three.js/blob/cf0b35d65304d9c37f116a872a650473c78d1e6c/examples/jsm/lines/LineSegments2.js#L65

I will also add a new issue in your flatline project

vasturiano commented 3 years ago

@lslzl3000 thanks for that. I updated the fatline dependency to include the raycaster method, and the pointer events should now be working correctly with the latest version (2.14.8).