DirectX8 - Direct3D Selecting 3D Objects With The Mouse

Started by
2 comments, last by count0 19 years ago
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
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 .

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?
yes, you can use D3DXVec3Unproject to convert the mouse point into a world ray, or use the method in pick sample.

This topic is closed to new replies.

Advertisement