Page 1 of 1

Terrain coordinates

Posted: Sun Feb 11, 2007 8:02 am
by ralo
Dear All,

I am trying to get the 3d coordinates; where the mouse has clicked on terrain.
What i am trying here is some thing like AOE, i had a object which will walk to the position where mouse is clicked on terrain.
Please advice if there is some good technique to implement that.

Thanks and Regards,

Posted: Sun Feb 11, 2007 7:20 pm
by bitplane
look at the C++ collision tutorial, it shows how to project a ray from screen coordinates and collide it with your world.
the only difference is you'll be using your mouse coordinates instead of the centre of the screen, using a terrain triangle selector to collide with, and writing it in .net of course.