Jump to content
  • Advertisement
Sign in to follow this  
yogeshpatel4all

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

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

Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!