Terrain coordinates

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ralo
Posts: 10
Joined: Sat Jan 27, 2007 1:06 pm

Terrain coordinates

Post 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,
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Have a look at the documentation for the ISceneCollisionManager::getCollisionPoint().

You just need to create a triangle selector for the terrain, and then use the collision manager to get a line from the camera through the mouse cursor. Take that line and ask the collision manager where the line and the triangle selector intersect.

Travis
Post Reply