Page 1 of 1

HELP!!! moving characters on terrain when click on it....

Posted: Sat Feb 24, 2007 5:30 pm
by stefanraabe
Hello
im building a world in irredit with a terrain and some houses.
Now i have modeled a character and want him to move on the map when i click on any position on the terrain.help please!!!!!!!!!!!!!
mfg :oops: :!: :!: :?: :idea: :cry:

Posted: Sun Feb 25, 2007 1:41 am
by Virion
Read this first, http://irrlicht.sourceforge.net/tutorials.html
i suppose that more tutorials will be coming very soon. :D

Posted: Sun Feb 25, 2007 4:06 am
by Baiame
http://irrlicht.sourceforge.net/docu/cl ... _node.html
http://irrlicht.sourceforge.net/docu/cl ... nager.html
http://irrlicht.sourceforge.net/docu/cl ... nager.html

Get the terrain node's mesh (TerrainSceneNode class). Make an ITriangleSelector (in the SceneManager class, maybe an octtree one) from that mesh. If the user clicks, find a ray by using getRayFromScreenCoordinates (CollisionManager class). Get the collision point using the getCollisionPoint function (CollisionManager class). Set the entity's position to the vector3df that you specified.

But don't take my word for it, I'm a noob, haha.