How to get a 3D position from 2D screen coordinates
How to get a 3D position from 2D screen coordinates
How would I get a 3D position from 2D screen coordinates? For example, how would I take the position of the mouse cursor and get a vector3df of the 3D position it's hovering over?
I think tutorial 7 (http://irrlicht.sourceforge.net/tut007.html) will explain it.
A little variation of the question: How do I get a vector3df from a vector2df? I gonna work with 2d values in my game (2d math - 3d gfx) and the scenenodes want 3d vectors for their positions... Since simply reading the two directional values from the vector2df doesnt work (no methods to access them), how do I realize such?
Tanuva
If you keep in 2 dimensions you can set the third value of the vector to 0. so you can convert the vector like this:
Code: Select all
vector2df pos2d(10,14);
vector3df pos3d(pos2d.X,0,pos2d.Y);
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.