I want to be able to click on a monster to walk to him and start attacking him. The part that doesnt make sense to me is the conversion between the mouse position, and the actual terrain position. There are camera angles to worry about, heights, seperate terrains, how is this done???? I am using Java LWJGL and rendering with OpenGL 4.4
Take the 2-minute tour
×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
|
Here's how I convert screen point to a ray in C++, but should be easily converted to Java:
Then you just test a ray-AABB intersection with your objects' AABBs. |
|||
|