Archived

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

simm

converting 2coordinates to x,y 3d space?

Recommended Posts

simm    122
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
Sean Doherty    144
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
simm    122
i dont want to check for intersections, what I really want to do is create vertices based on my mouse coords.

Share this post


Link to post
Share on other sites
Sean Doherty    144
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