eXi: Yes, just wanted to clarify why it isn’t needed to use it just as a frustrum-culling, and use it to for actual impelemtation.
undercover: You are about right… BUT, if implemented correctly, you won’t have that problem.
Implement the algorithm by:
- Find your upper left of your selection in screenspace (pixels)
- Find lower right of your selection in screenspace (pixels)
- Use canvas to deproject your upper left hud location, then you get a world location on your near plane, and the direction to the backplane that the pixel maps to. This will adjusted for your aspect ratio and FoV
- Trace from this location in the direction until you hit world geometry. This will be your upper left world location where you start using your box
- Do step 3 and 4 with your lower right location of your box.
- Now you have the upper left, and lower right location in world locations.
- Now you can get all units between these points by doing a boxtrace without beeing afraid that it will be distorted by the perspective.
Ofcourse, this is just a optimized version for a smaller area than how you have done it. You can still do it the way you have done.
I hope this explanation was somewhat manageable to follow now that I had more time to write, rather than write while compiling at office