Jump to content
  • Advertisement
Sign in to follow this  
Jacob Roman

DirectX8 - Direct3D Selecting 3D Objects With The Mouse

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

I already have converted the world coordinates to screen coordinates using D3DXVec3Project, but I'm having some trouble with finding out if my mouse coordinates are within the VOut values, which are the converted coordinates. Any help with this would be appreciated. Thanks. :D

Share this post


Link to post
Share on other sites
Advertisement

If I understood you, this is a _pick_ question.

Usually you convert mouse screen coordinates (a point) to world coordinates (a ray), then use ray-object intersection test to find out the object.

D3D8 SDK has a pick sample. And there a good article about this http://www.mvps.org/directx/articles/rayproj.htm .

Share this post


Link to post
Share on other sites
Thanks. So I pretty much have it backwards, right? I was supposed to have the mouse coordinates converted to 3D coordinates.

Then in that case, wouldn't D3DXVec3Unproject do the trick?

Share this post


Link to post
Share on other sites
yes, you can use D3DXVec3Unproject to convert the mouse point into a world ray, or use the method in pick sample.

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!