3-D Perspective Viewing Pipeline
Eric Leive, Xiang Lan Zhuo

Functions implemented

3-D transformations
  • translate3D()
  • scale3D()
  • rotateZ()
  • rotateX()
  • rotateY()
  • rotateXYZ()
  • shearZ()
  • perspProject()
Perspective Viewing Pipeline
  • Set3DViewTransform()


Unit Cube

    

The viewing structure parameters are:

VRP = {0.5, 0.5, -2}
COP = {0.5, 0.5, -4}
VPN = {0.0, 0.0, 2.5}
VUP = {0.0, 1.0, 0.0}
du = 1.0
dv = 1.0
screen (X,Y) = (100, 100)
front = 1.0
back = 5.0
(x,y) values for the 8 corners:

corner1: (0, 0, 0) - > (75, 25)
corner2: (0, 1, 0) - > (75, 75)
corner3: (0, 1, 1) - > (70, 70)
corner4: (0, 0, 1) - > (70, 30)
corner5: (1, 1, 0) - > (25, 75)
corner6: (1, 1, 1) - > (30, 70)
corner7: (1, 0, 1) - > (30, 30)
corner8: (1, 0, 0) - > (25, 25)

Altering the distance between COP and VRP changes the size of the final image being projected.
By changing the direction of the VUP vector (i.e. when it's no longer parallel to the Y axis) the final image rotates on the plane of the image.
Modifying the view window size on this image has a similar effect as changing the distance between COP and VRP. The image shrinks when the view window is enlarged and vice versa. The proportion of the image can also be skewed by changing the horizontal and vertical without keeping the proportion.


Viewing parameters are:

VRP = {0.0, 1.5, -2.0}
COP = {0.5, 0.5, -4}
VPN = {0.5, -1.2, 2.5}
VUP = {0.0, 1.0, 0.0}
du = 1.0
dv = 1.0
screen (X,Y) = (100, 100)
front = 1.0
back = 5.0
(x,y) values for the 8 corners:

corner1: (0, 0, 0) - > (69, 24)
corner2: (0, 1, 0) - > (71, 70)
corner3: (0, 1, 1) - > (76, 85)
corner4: (0, 0, 1) - > (74, 45)
corner5: (1, 1, 0) - > (19, 73)
corner6: (1, 1, 1) - > (33, 87)
corner7: (1, 0, 1) - > (34, 49)
corner8: (1, 0, 0) - > (22, 29)

Perspective View in Hierarchical Model

     Our system sets the VTM as a global transformation matrix. In order to incorporate Perspective viewing in the modeling system, all ltm (local transformation matrix) must be multiplied with VTM before calling any drawing function.
ltm (new) = VTM * ltm (old)