• Advertisement
Sign in to follow this  

Control to World coordinate...

This topic is 4517 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

The device already transforms the world coordinates into the windows control coordinate. But what if I want to transform a coordinate from the 2d control to 3d world space? Thanks, Devin

Share this post


Link to post
Share on other sites
Advertisement
A 2D coordinate (such as a mouse click location) actually generates a "ray" in 3D space - effectively an infinite number of points along a defined line from the near plane to the far plane.

You can use the D3DXVec3Unproject() function to take the various matrices and coordinates and produce a ray iirc.

hth
Jack

Share this post


Link to post
Share on other sites
Super, thanks. I was wondering, which matrices to I unproject? I see in the device that there are several matrices. Are all of the used during the scene?

Share this post


Link to post
Share on other sites
Nevermind, I see that in the project and unproject argument list it provides for each.

Thanks,

Devin

Share this post


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

  • Advertisement