Archived

This topic is now archived and is closed to further replies.

converting 2coordinates to x,y 3d space?

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

im trying to convert my 2d mouse co ordinates into 3d x, y values i placed a square in a 3d world, where its 1,1 and shows up at 209, 195, what i want it to do, is have it show up as 1,1, what calculations do i have to take in affect to do this?

Share this post


Link to post
Share on other sites
Projecting your mouse coordinates into 3D space and checking for intersection is explained in the following links:

http://www.mvps.org/directx/articles/rayproj.htm
http://www.mvps.org/directx/articles/improved_ray_picking.htm

Understanding is a three edged sword...

Share this post


Link to post
Share on other sites
I may be misunderstanding your question; but you can change the Flexable Vertex Format (FVF) of the square to D3DFVF_XYZRHW which will render to screen space as opposed to world space. Since your mouse can easily be converted to screen space this should solve your problem?


Understanding is a three edged sword...

Share this post


Link to post
Share on other sites