Hey,
I am currently designing an RTS Game in XNA. So far I have a Terrain Model generated from a Heigthmap and some Units that are drawn on it.
The next step would be to give the units commands on where to move. To do that I have to calculate the exact position of the terrain behind the cursor when it's clicked.
For Units selection I simply generate a Ray pointing from the cursor away into the screen and select the first Unit intersected by that ray. Now that won't work for the terrain, because the whole thing is one model.
Can anyone help me?
Regards Nick
P.S: i just found this video on youtube which presents exactly the solution to my problem... unfortunately without any reference to the code. http://www.youtube.com/watch?v=czHW3oK8_oI