简体   繁体   中英

Plot 2d point on 3D plane drawn in 2d

I am attempting to draw a point from a 2d plane on a 3d plane that is drawn in 2d. I'm not sure how to adjust the y position based on the angle of the perspective. As you can see in the image linked below (Stack Overflow won't let me include the image because I just signed up), if the point is at the center point of the rectangle, it would need to be shifted up slightly when viewed from an angle to account for distance from the viewer. Can anyone provide an equation to help?

范例图片

Say the point in the rectangle is given by (x,y), and the coordinates we're looking for in the second image are (x', y').

w = y + y 0
y' = k atan(w/h)
r = sqrt(h 2 + w 2 )
x' = k atan(x/r)

where k is a scaling factor for the whole image, h is "altitude of the viewpoint above the plane" and y 0 is, roughly, distance to the object.

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