# 2D to 3D Conversion

This topic is 4969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 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 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.

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 13
• 41
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632964
• Total Posts
3009536
• ### Who's Online (See full list)

There are no registered users currently online

×