Sign in to follow this  
bioM

mapping 2D coordinate to 3D coordinate

Recommended Posts

hi i have created a texture from a file and render it as fullscreen on 3D window. now i want to draw another 2D image on 3D window with coordinates (x,y) from 2D as we often use with GDI functions in 2D . the problem here that GDI coordinate is completly different from 3D coordinate => how to map 2D coordinate to 3D coordinate? anybody can help me?

Share this post


Link to post
Share on other sites
Are you using 3D graphics to create 2D images... by that I mean, are you wanting your images to appear as though they were drawn like they might be via GDI??

If so, you can look into using "Transformed and Lit" geometry, which has a 3rd and 4th coordinate (Z and W) but you can just leave those at 0.0f and 1.0f respectively. The coordinate system is the same as GDI (top-left = 0,0)..

Alternatively you'll have to work with the various perspective projection matrices to map the 3D coordinates to your desired 2D ones. There are a number of D3DX functions that will do the "dirty work" here - so you just need to pick the correct one.

hth
Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this