I’ve reached a subject that I’ve become thoroughly stuck on. I’m trying to figure out how to implement mouse clicks in my OpenGL program. Specifically, I want to be able to have a simple way where if the use holds a mouse over an object and clicks, then that object is “selected.”
So let me see if I at least have my logic correct: It seems like what I really need is a way to convert from “Screen” coordinates to the 3D “World” coordinates. If I could do that, then I could manually check to see if any objects were selected. Does this sound about right?
There are also other ways: say you transform object AABBs into screen space, then you don’t need to do the ray casting and can do the selection the old way (say you also sort the AABBs by their distance and pick the closest matching one). Anyway, if you have an idea of your own, don’t dismiss it, because you hear something else in these forums, try it and learn.