Finding the mouse position in 3D

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
Barakat

Finding the mouse position in 3D

Post by Barakat »

I am working on an RPG game. It will have a top down view in which the user clicks the ground for the character to move to. But I can't think of a way to find the position of the mouse in the 3D world. I know it has something to do with ray tracing, but I have yet to make working code.

So basicly, I need to know how to find the position of the mouse in the 3d world. Any help is greatly appreciated.
Guest
Posts: 35
Joined: Mon Feb 02, 2004 7:17 pm
Location: Russia, Saint-Petersburg

Post by Guest »

I think it's much better to use http://irrlicht.sourceforge.net/docu/cl ... er.html#a1 in your task.

I think you need something else than just a node. Cause using that getSceneNodeFromScreenCoordinatesBB () you'll receive your level node mostly. An if your level is big enough than it won't help you.

The best way I can see is to look at this http://irrlicht.sourceforge.net/tut007.html
There is an example of how to use ISceneCollisionManager::getCollisionPoint function.

Hint: BTW, you have to create ITriangleSelector object to use in this function, so you can create it from the node wich is obtained by the getSceneNodeFromScreenCoordinatesBB.
there is another guest...
Post Reply