Graphics Programs Reference
In-Depth Information
Points in 3D space are defined by x-, y-, and z-coordinates, typically measured from an
origin that is the point of intersection of the COV with the picture plane. The x-value is
the horizontal distance from the origin, with positive values to the right and negative val-
ues to the left. The y-value is the vertical distance from the origin, with positive values
above and negative values below the origin. The z-value is the depth from the origin,
with positive and negative values going into and coming out of the screen respectively.
The origin of the two-dimensional perspective drawing is also at the point of intersection
of the COV with the picture plane. The two-dimensional coordinates xs,ys are called
screen coordinates and are measured from the origin.
To see how to convert from 3D coordinates to screen coordinates, let's look along the
x-axis in Figure 6.3. The projection of the y-axis value of the 3D point intersects the
picture plane at some screen value ys. We will assume that the viewer is some known
distance d from the picture plane. This gives us two similar triangles whose sides are
in proportion to one another. Thus the ratio of the height and the base of both triangles
must be the same. We can write this as
ys/d = y/(d+z)
Multiplying both sides of the equation by d, we get
ys = y * d/(d + z)
Similarly, we get
xs = x * d/(d + z)
Figure 6.3 Side view of projection onto the picture plane
Search WWH ::




Custom Search