D3DXVec3Unproject in irrlicht - UERGENT
Posted: Tue May 01, 2007 4:10 am
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);
}
}
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);
}
}