Jump to content
  • Advertisement
Sign in to follow this  
devronious

Control to World coordinate...

This topic is 4614 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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!