:-[ I need help.
I’ve looked for many hours trying to find information on how to convert Mouse coordinates (AWT) into World Coordinates (JOGL). I’ve tried OGL’s selection meathods, I’ve tried gluUnProject(), and none of it works. I’ve been looking lately on how to mathmatically do it my self with basicaly no success (I can move the ‘camera’ around, or any other object based on mouse movement in a direction (vectors) , but I can’t actually pick a point in space. Which is what I need to do.)
I then heard about what sounds like a most wonderful technology. Raytracing. Supposedly after getting a mouses (x,y) coordinates you can convert these to world coordinates (x,y,z) and then shoot a ray in a certain direction. After which you can check for intersection with objects, among other things.
Here is my current problem. I can’t find any relevant information on how to convert mouse-to-world coordinates. I would like to do this so I can use ray picking rather then the other meathods. Ray picking sounds more powerful, flexible, and better suited to what I want to do.
If someone would be so kind as to point me in the right direction or better(post some code ;D), then I would be most grateful. Ofcourse I will keep working on it myself, it seems to be a well guarded secret (almost like nobody wants to share :-[ ). I’ve been under the impression it has something to do with the inverse of the model view matrix but I’m not sure how to get that.
Thanks for your help(in advance). I hope to bug you in the future.