proportions of a perspective-deformed rectangle

后端 未结 10 1631
萌比男神i
萌比男神i 2020-11-29 17:31

Given a 2d picture of a rectangle distorted by perspective:

\"enter

I know tha

10条回答
  •  粉色の甜心
    2020-11-29 17:48

    Draw a right isosceles triangle with those two vanishing points and a third point below the horizon (that is, on the same side of the horizon as the rectangle is). That third point will be our origin and the two lines to the vanishing points will be our axes. Call the distance from the origin to a vanishing point pi/2. Now extend the sides of the rectangle from the vanishing points to the axes, and mark where they intersect the axes. Pick an axis, measure the distances from the two marks to the origin, transform those distances: x->tan(x), and the difference will be the "true" length of that side. Do the same for the other axis. Take the ratio of those two lengths and you're done.

提交回复
热议问题