04-17-2024, 08:49 PM
Is there a way to get elements inside a 2D rectangle?
I mean, probably I can draw an overly sprite for the rectangle following user's pointer, but after having screen U,V coordinates I'll need a hit test on elements that I don't know how to solve. Maybe getting a camera direction ray and move it along the edges, but that would not retrieve elements inside the rectangle.
Maybe a bounding box created from perpendicular plane to camera and long enough could do the job, but I am totally lost
Any tip about this?
I mean, probably I can draw an overly sprite for the rectangle following user's pointer, but after having screen U,V coordinates I'll need a hit test on elements that I don't know how to solve. Maybe getting a camera direction ray and move it along the edges, but that would not retrieve elements inside the rectangle.
Maybe a bounding box created from perpendicular plane to camera and long enough could do the job, but I am totally lost
Any tip about this?