Page 1 of 1

D3DXVec3Project Function in irrlicht

Posted: Sun Apr 22, 2007 11:21 pm
by castefani
Sorry my english.

I´m converting a DirectX program to irrlicht.
Directx has a function to projects a vector from object space into screen space: D3DXVec3Project.
How to implement D3DXVec3Project into irrlicht?

Posted: Sun Apr 22, 2007 11:48 pm
by Luben
What do you need it for?

You could do it by creating a transformation matrix. You can get the current transformations with Driver->getTransform().

Here's an example

Code: Select all

matrix4 Mat;
Mat=Driver->getTransform(ETS_WORLD)*Driver->getTransform(ETS_VIEW)*Driver->getTransform(ETS_PROJECTION);
vector3df TheVector(1,1,1);
Mat.transformVect(TheVector);
TheVector should in the end hold a transformed screen space vector.

Posted: Tue Apr 24, 2007 1:43 am
by castefani
Tks Luben.
I will try your sugestion.