Sign in to follow this  

2D to 3D Conversion

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

I am working on an application consisting of two parts. The first one is a simple wizard having a drawing area and an image list on left. Images can be selected from the list and drawn on the drawing area. The second module is a 3D application that will show this drawing area in 3D and the 3D objects (corresponding to the different images drawn on the area). That is an image drawn in the wizard will be viewed in 3D in the end. I am using x files for the 3D objects. What a i want is a way to calculate the 3D position of the objects corresponding to the 2D position of the image in starting drawing area? That means a method of calcuating 3D position provided the 2D position. How will i do this? Thanks for any help :)

Share this post


Link to post
Share on other sites
Simply put, you can't, unless you know how far away from the camera each object is (or unless you're planning on having all your 3D objects neatly centered on a plane). A position on the 2D plane is enough to find a line in 3D space (a line from the eyepoint, through that 2D point on the plane in space) but to place objects you need to know whereabouts on that line they go.

Share this post


Link to post
Share on other sites
given 2dposition(x,y) and 3dposition(x,y,z) :

3dposition.x=2dposition.x
3dposition.y=3dposition.y
3dposition.z=0 (ground level)

You're 3-d coordinate system may very.

Share this post


Link to post
Share on other sites
Thanks superpig, i got ur idea but still dont know how to accomplish the task

Thanks to Kelly G too but i could not get the formula. It simply states that x and y coordinates will have the same value in 3D but it does'nt look like that...

Share this post


Link to post
Share on other sites
Oh, I see, it depends on which two dimensions you have. If you are laying down objects on a map, and then want to view the map as a floor-plane with the objects spread around, then the conversion would be that simple. It sounds like your wizard only allows the user to have access to two dimensions. That means the objects will be co-planer. In that case, what I suggest will work (you assume the third, unspecified dimension is a fixed number). As superpig says: you cannot compute 3 dimensions from 2.

Share this post


Link to post
Share on other sites

This topic is 4659 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.

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