简体   繁体   中英

How to calculate depth coordinate of the 3D rectangle?

长方形

I have 3D rectangle, as shown in the image.

Here I know depth distance and x and y coordinates of the one end. Based on these two values I would like calculate coordinates at the other end.

For clear view, I have attached a screen.

If you don't know the relation between 2D and 3D (ie the projection formulas used) then you can't apply the depth.

That said, if you make the following assumptions:

  • the projection type is orthographic
  • a depth line is projected as a 45 degrees line
  • the length of a 45 degrees line is the same as if it was a normal line

... then you could calculate it with Pythagoras' theorem as follows:

三角形

The red lines are equal (in case of a 45 degree line), so:

x1 = 100  +  50 * (1 / sqrt(2))
y1 = 50   -  50 * (1 / sqrt(2))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM