Sign in to follow this  
yogeshpatel4all

How to get 3d space coordinates from 2d Screen Coordinates

Recommended Posts

You have to know the z value of the of the cooridnates you are trying to figure out. Otherwise you're basically just guessing around. What exactly do you want to this for. Maybe we can help better if the purpose is known.

-AJ

Share this post


Link to post
Share on other sites
Uhh, if everything is thought of as 2D, then there is no z axis. Other then that I don't know how.
I assume you mean something along the lines of: the game is 3D, but is drawn on my 2D moniter.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It is possible to generate a ray from camera position which goes through near z plane using the 2d location on screen. Of course it requires a view/camera matrix and projection matrix.

In 2d terms when the ray is projected on the screen it is only a dot since the projected starting and ending points are in the same location.

Try searching topics with "pick ray" on Google. DX SDK has/had also a working sample for generating a pick ray.

I wish this was what you were looking for.

Cheers

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