D3DXVec3Project Function in irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
castefani
Posts: 4
Joined: Sun Apr 22, 2007 11:14 pm

D3DXVec3Project Function in irrlicht

Post 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?
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post 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.
Last edited by Luben on Tue Apr 24, 2007 3:32 pm, edited 1 time in total.
If you don't have anything nice to say, don't say anything at all.
castefani
Posts: 4
Joined: Sun Apr 22, 2007 11:14 pm

Post by castefani »

Tks Luben.
I will try your sugestion.
Post Reply