Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectX8 - Direct3D Selecting 3D Objects With The Mouse

Started by Jacob Roman Apr 25, 2005 at 9:03 PM 2 replies 1.4k views
Original Post
Jacob Roman
Jacob Roman
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
count0
count0

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 .

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.