screen coords to world ::?
hallo,sorry...i guess somebody have been post this question before but i can't find it,
how do i get world coordinates from screen coordinates...? for mouse
Use the D3DXVec3Transform(D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM) function (copied straight from the docs :) ).
Supply your screen x,y,z as a vector pV and the world matrix as pM. You will get the transformed co-ords in pOut as a vector.
Supply your screen x,y,z as a vector pV and the world matrix as pM. You will get the transformed co-ords in pOut as a vector.
Do notice however, that you can't get a xyz world point from a xy screen point. Instead, you will get a line
posted by Anonymous :
Do notice however, that you can't get a xyz world point from a xy screen point. Instead, you will get a line
what do you mean get a line ?, i dont understand...:) sorry...
actually i want to make my mouse cursor move along terrain map... like...warcraft3...maybe...
help me....
:)
thanks
Do notice however, that you can't get a xyz world point from a xy screen point. Instead, you will get a line
what do you mean get a line ?, i dont understand...:) sorry...
actually i want to make my mouse cursor move along terrain map... like...warcraft3...maybe...
help me....
:)
thanks
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement