Jump to content
  • Advertisement
Sign in to follow this  
be17_17y

screen coords to world ::?

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Do notice however, that you can't get a xyz world point from a xy screen point. Instead, you will get a line

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!