sorry my english.
I needed to convert a mouse point to world space.
In directx I use D3DXVec3Unproject to make this.
How to implement this fueature in irrlicht?
I make this implementation but not work.
Help please
----------------------------------------------
vector3df v(event.MouseInput.X, event.MouseInput, 0);
Engine3D* engine;
engine->Unproject(v);
.
.
.
void Engine3D::Unproject(vector3df& vector)
{
matrix4 Mat;
Mat = driver->getTransform(ETS_WORLD) * driver->getTransform(ETS_VIEW) * driver->getTransform(ETS_PROJECTION);
if (Mat.makeInverse())
{
Mat.transformVect(vector);
}
}
D3DXVec3Unproject in irrlicht - UERGENT
Code: Select all
//! Returns a 3d ray which would go through the 2d screen coodinates.
//! \param pos: Screen coordinates in pixels.
//! \param camera: Camera from which the ray starts. If null, the
//! active camera is used.
//! \return Returns a ray starting from the position of the camera
//! and ending at a length of the far value of the camera at a position
//! which would be behind the 2d screen coodinates.
virtual core::line3d<f32> getRayFromScreenCoordinates(
core::position2d<s32> pos, ICameraSceneNode* camera = 0) = 0;
If you don't have anything nice to say, don't say anything at all.