0

so the quest is this, I got an ARPointCloud with a bunch of 3d points and I'd like to select them based on a 2d frame from the perspective of the camera / screen.

I was thinking about converting the 2d frame to a 3d frustum and check if the points where the 3d frustum box, not sure if this is the ideal method, and not even sure how to do that.

Would anyone know how to do this or have a better method of achieving this?

Heestand XYZ
  • 1,684
  • 3
  • 16
  • 33
  • 1
    If you’re using ARKit with SceneKit, I’d recommend looking into the `projectPoint` function to convert the whole set of points to 2D screen space and check for containment in the rest that way. Constructing a frustum based on arbitrary side planes (as opposed to a viewing camera) tends to be more cumbersome. – rickster Oct 31 '17 at 15:47
  • @rickster That's a great idea! Thanks. I did solve it in a different way, by creating a frustum and splitting it up into two tetrahedrons, then I found this script to check if a point is inside one of the tetrahedrons: https://stackoverflow.com/a/25180294/4586652 Tho it's slow, so I'll test your idea! – Heestand XYZ Nov 01 '17 at 12:54

0 Answers0