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.
Finding the mouse position in 3D
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.
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...