
(A) Find the outward pointing unit normal of this triangle.
Find edge vectors:
The outward pointing normal is (q x r) = [4 0 -4 0]T.
The outward pointing unit normal is then [.707 0 -.707 0]T.
(B) Find the angle between vectors q=(v2-v1) and r=(v3-v1).
Use (q . r) = ||q|| ||r|| cos(theta)
theta = 0.76 radians
(C) Derive the equation for the plane defined by this triangle.
We know that the normal is in the direction [1 0 -1 0]T
Point v1 is in the plane. Substituting v1 into the above equation, we get:
The plane equation is then:
This implies that:
(A)Find the projection Q of point P=[1 2 3 1]T onto this plane.
Choose an arbitrary point A in the plane:
From the plane equation, the plane normal is [3 1 -7 0]T
Normalizing, the unit normal nHat is [0.391 0.130 -0.911 0]T
Find Q by subtracting from P the normal component of (P-A):
(B)Use the plane equation to check that Q is on the plane.
Check: 3(1.71) + (2.24) - 7(1.34) + 2 = 0
OK
(C)Check that vector P-Q is in the direction of the plane normal.
P - Q = [-0.71 -0.24 1.66]T
This is just nHat scaled by -1.82.
Rotate the sofa to its final orientation, and then translate it to the
center of the N wall. This gives the following equation to transform
any point P on the couch to the desired position:
(B) Find the transforms to place double doors in the center of the E wall. Place the doors so that they are opening inward at a 30 degree angle.
DOOR 1: Make this the North door. Rotate 150 degrees about z to put
into the final orientation, then translate up the East wall:
DOOR 2: This is the South door. Rotate 30 degrees about z to put
into the final orientation, then translate up the East wall:
For SHyz (shy, shz)
This matrix shears in the y and z directions proportional to the x component:

For SHxz (shx, shz)
This matrix shears in the x and z directions proportional to the y component:

Basic strategy: rotate onto a main axis, rotate about that axis by theta, then undo the rotation onto the main axis. In this case, we begin by rotating the diagonal onto the x-axis.
P' =
Test the transform for P = [1 0 0 1]T, theta = 2PI/3:
(A)Find the view volume parameters for the portion of 3D space that you can see that falls outside the window. Use the proper coordinate frame (WC or VRC) for each parameter.
VRP: choose a point on the North wall
VPN: choose vector perpendicular to the North wall, pointing toward the viewer
VUP: z is up
Window: umin, umax, vmin, and vmax are defined by the positions of
the corners of the real window in the VRC coordinate system
PRP: the position of the viewer's eye in VRC coordinates
Front clip plane: 0
Back clip plane: -100'
Only PRP changes, to [0' 6' 20' 1]T
Estimate a set of view volume parameters to obtain this shot. Explain
your choices.
VRP: choose a view plane passing through the runner
VPN: choose a vector pointing toward the viewer. The x component has
a greater magnitude than the y component because we see more of the
front of the runner than of his right side.
VUP: z is up
Window: choose umin, umax, vmin, and vmax to give a little space
above and below the runner. Make umax slightly larger than -umin to
allow the runner "room to move." (This helps avoid the perception that
the runner is trying to escape from the image.)
PRP: pull the camera back from the runner, moving it in the VPN
direction. This is a low shot, with the height of the camera near the
runner center of mass.
Front clip plane: 0
Back clip plane: -100' This is not very important here, although the
brick wall needs to be in the image.
Trace through the Cohen-Sutherland clipping algorithm for a 3D perspective projection canonical view volume. Find the endpoints of the clipped line segment using the parametric line equation.
We are not given a zmin value for the front clipping plane, so assume it is 0.
Plug this result into the parametric expressions for x, y, and z to
find A':
Plug this result into the parametric expressions for x, y, and z to
find B':
(A)The viewpoint is at the origin. Trace the steps required to determine whether this is a front-facing or back-facing polygon. Assume that the vertices appear to be numbered in counterclockwise order when the front-facing surface is visible.
If the vertices are listed in counterclockwise order, then the outward
pointing normal is in the following direction:
Now we need to test whether this normal is pointing toward the viewer.
If so, it is front facing.
First, we construct a vector pointing from the triangle to the
viewer. Let the origin be point O = [0 0 0 1]T. Then
vector (O - P1) = [1 1 1 1]T points from the triangle
toward the viewer.
Next, we test whether n is in the direction of (O - P1).
Because this is a negative number, n is not in the direction of (O -
P1). It points away from the viewer, and so this is a back-facing
polygon.
(B)How does your answer change if the viewpoint is at point V
instead of at the origin:
In this case, the vector from the triangle to the viewer changes.
Here, we can use (V - P1) = [0 2 1 1]T.
We test whether n is in the direction of (V - P1).
Because this is a positive number, n now points toward the viewer, and
this is a front-facing polygon for the new viewpoint V.
Step 1: Initialize the frame buffer and z-buffer.

Step 2: Scan convert the red polygon.

Step 3: Scan convert the blue polygon.

Step 4: Scan convert the green polygon.
