- What are the (x,y) values for the eight corners of the cube in the first required image?
(25,25) (75,25) (75,75) (25,75)
(30,30) (70,30) (70,70) (30,70)
- How does modifying the distance between the COP and the VRP affect the appearance of the cube in the first required image?
The effect is to zoom in and out on the scene by changing the focal length. This also changes the amount of the scene that is shown in the screen output. Essentially, the cone that forms what the camera can see is shrinking and expanding.
zoomed in (relative to required image 1)
 |
- How does modifying the direction of VUP modify the appearance of the cube in the first required image?
Changing VUP changes the angle at which the camera is oriented. If VUP were upsidedown, the scene would be rendered upsidedown.
VUP rotated 45 deg
 |
- How does modifying the size of the view window modify the appearance of the cube in the first required image?
The cube appears to shrink when the view window is expanded because more of the scene is being shown in the picture. Note that this method yeilds more perspective distortion than changing the focal length.
view window expanded
 |
- What extensions did you do for this assignment, how did you do them, and how well did they work?
We implemented a box primitive, which is defined by 8 points.
It has the following functions:
Box_init:
Takes a pointer to a box, a point and three doubles.
Point sets the origin, and three doubles are dx, dy, dz.
It can only create boxes in its standard orientation (as in each side is
parallel to x, y, or z axis).
Box_xform:
It takes a transformation matrix and a box pointer, and applies the
transformation to every point of the box.
Box_draw:
Takes a point to a box, image pointer and a pixel. It sets up the 12 sides
of the box and draws each one of them. Before drawing, it divides the x and
y value of each point by the h component of that point.
Box_print:
Simply prints the coordinates of each vertex.
We used the box primitive to create the required images.
We also tried to implement parallel projection. We defined a new struct
named ParallelView, which has the following components:
typedef struct {
Point vrp;
Vector vpn;
Vector vup;
Vector dop;
double f;
double b;
int screenx;
int screeny;
int umin;
int umax;
int vmin;
int vmax;
} ParallelView;
Unfortunately, it does not work yet.
We made an animation out of the cube box, where a camera placed on a circle
parallel to the xz-plane looks towards the center of the box. The travelling
speed of the camera is not uniform, as we simply increment (decrement) x
value of the camera by a constant, instead of uniformly changing theta.
animated in 3D
 |