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

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
stefanraabe
Posts: 1
Joined: Sat Feb 24, 2007 5:20 pm

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

Post 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:
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Read this first, http://irrlicht.sourceforge.net/tutorials.html
i suppose that more tutorials will be coming very soon. :D
Baiame
Posts: 41
Joined: Sun Oct 15, 2006 11:33 am

Post 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.
Post Reply