## Description

Consider the imaging system of Figure 2-1 in Horn (page 20) having a pinhole at the origin

with the z-axis horizontal (positive z to the left), the y-axis vertical (positive y up) and the

x-axis forward (positive x out). The image plane is located at z = f

′

(f

′ > 0). All events in 3-D

are assumed to take place in the space z < 0. (x

′

, y′

) are points in the image plane and (x, y, z)

are points in world space. Curves in space can be defined parametrically using the parameter t.

1. For a line in 3-D the parametric equations are:

x = x0 + ta

y = y0 + tb

z = z0 + tc

for constants x0, y0, z0, a, b and c. As t takes on values in the range (−∞, ∞) we get a line.

Write expressions for the image coordinates x

′ and y

′

in terms of these constants and f

′ and t

for both the perspective and orthographic projection of the line. Is the projection of the line

also a line for perspective projection? for orthographic projection?

Using the constant settings:

x0 = .5

y0 = −1

z0 = 0

a = 0

b = 1

c = −1

f

′ = 1

Write a C program to generate images of both the perspective and orthographic projections of

the line. Since ±∞ is difficult to represent in a finite word length use values of t between 0.01 and

10000. The sample C program will only display regions in the range −4 ≤ x

′ ≤ 4, −4 ≤ y

′ ≤ 4.

You should compute for which range of t the values of x

′ and y

′ will fall within this range and

set t accordingly. What happens in the perspective projection case as t goes to ∞? Is this

consistent with the image that your program generates?

2. For two parallel lines in a plane that is parallel to the image plane the value for z is a

constant, say z0. The parametric equations for these lines are

x = x1 + ta

xˆ = x2 + ta

y = y1 + tb

yˆ = y2 + tb

z = z0

zˆ = z0

Where line 1 is defined by (x, y, z) and line 2 is defined by (ˆx, y, ˆ zˆ) and t is in the range (−∞, ∞).

Write expressions for the image coordinates x

′ and y

′

in terms of t and the constants above for

both the perspective and orthographic projections of the lines.

Using the following constant settings:

x1 = .5

x2 = −.5

y1 = −1

y2 = −1

z0 = −1, −2, −3

a = 1

b = 1

f

′ = 1

write a C program to generate images of both the perspective and orthographic projections of the

lines by letting t range from 0.01 to 10000. Use the magnification equation to show whether or not

the projections of the lines will be parallel for both perspective and orthographic projection. Is

your answer consistent with the images that your program generates? Is orthographic projection

a good approximation to perspective projection for this case? Why? What occurs if z0 = f

′

?

3. Consider two parallel lines that lie in a plane that is not parallel to the image plane.

Assume that these lines are defined by

x = x1

xˆ = x2

y = y0 + tb

yˆ = y0 + tb

z = z0 + tc

zˆ = z0 + tc

Write expressions for the image coordinates x

′ and y

′

in terms of t and the above constants

for both the perspective and orthographic projections of the lines. Using the following constant

settings,

x1 = −1

x2 = 1

y0 = −1

z0 = 0

b = 0, 1, −1

c = 1, −1

f

′ = 1

write a C program to generate images of both the perspective and orthographic projections of

the lines by letting t range from 0.01 to 10000. You should experiment with several values of b for

different images. Use the magnification equation to show whether or not the projections of the

lines will be parallel for both perspective and orthographic projection. Is your answer consistent

with the images that your program generates? Is orthographic projection a good approximation

to perspective projection for this case? What happens in the perspective projection as t goes to

∞? Is this consistent with the images that your program generates for this case?

Your TA will supply a C program to generate your image files that you will display. For each

case you only need to change the indicated two assignment statements for xprime and yprime.

You will also need to add declarations for any other variables that you may need, for example,

to define constant settings. The subroutine plot logical point maps the (x

′

, y′

) image plane over

the range −4 ≤ x

′ ≤ 4 and −4 ≤ y

′ ≤ 4 to the pixel image coordinates. Your TA will also

supply tools to use to display your image files.