Hi! I have a polyData consisting of lines. When I click on the screen, how to get the closest line/cell.
My idea is the following.
- Get line or two points of the ray representing downwards line from camera (how? where to look for example?)
- Get polyData lines:
let lines = polyData.getLines()
- Iterate lines (how?)
- Get two end points (how?)
- Calculate distance from the ray to particular line. I think to port
Please advise if there is a better solution