Specifications of 3 D Views PDF
Specifications of 3 D Views PDF
Specifications of 3 D Views PDF
v
• Specification of a 3D view.
View
plane
• Implementing parallel projections. VUP
VRP
• Implementing perspective projections. VPN
n u
• Defined using:
v
• The view window is then defined by (umin, vmin), (umax, vmax).
View
plane
VUP • The centre of projection and Direction Of Projection (DOP) are
VRP defined by a Projection Reference Point (PRP) and an indicator
VPN
u of the projection type:
n
• The VRP (point) and VPN and VUP (directions) are specified in
a right handed world (application model) coordinate system.
• Parallel projection
View
plane
v DOP
View
plane CW
CW VRP
VRP
VPN PRP
u VPN
n
n
Center of
projection • If the projection is parallel, the the DOP is defined by the
(PRP) direction between the PRP and the centre of the projection
window.
• It is simpler for the programmer to change the direction of • Finite view volumes are defined by selecting the signed
projection required (rotate / move the camera), at the expense quantities F and B which define the locations of the front and
of extra complexity if the PRP is moved (i.e. to get different back clipping planes.
views of the object – change the lens).
• Both these planes are parallel to the view plane, thus F and B
• OpenGL uses a very similar method to specify the view volumes are defined along the VPN.
– we will come back to this. Back
clipping
plane
• The camera analogy is very powerful and general. Front
View
plane
clipping
plane
VRP
VPN
F B
Specification of 3D views Specification of 3D views
• We want a finite view volume because we do not want to draw • To display the contents of the view volume the objects are
objects close (or behind us) and objects which we cannot see. mapped into a unit cube whose axes are aligned with the VRC
system (called the Normalised Projection Coordinates (NPC)).
Back
clipping
View plane • Objects which are far away are squashed more (small)!
Front plane
clipping • To create a wire-frame display of the contents of the 3D
plane VRP
viewport we can simply drop the z coordinate.
VPN
DOP
B
F
• Steps 1 and 2 combined produce the view orientation matrix • Step 3, shearing (so that z value represents distance from the
(GL MODELVIEW), while steps 3 and 4 give the view mapping matrix viewer:
(GL PROJECTION). y y
DOP
• Steps 1 and 2 are logical.
shear DOP’
VPN
• BUT .... VPN
-z -z
• Steps 1 and 2 are the same as those in the parallel case but an • The final composite transformation matrix is given by
additional step brings the PRP to origin. ∗ =S
Nper per Hpar T (−P RP )RT (−V RP ).
2. Rotate the VRC such that it is aligned with the world However the additional step to the computation of Nper
coordinate system. transforming the truncated pyramid to a parallelepiped will:
3. Translate so that the centre of projection (i.e. the PRP) is at 1 0 0 0
0 1 0 0
the origin.
M =
0 0 1 .
−zmin
1+zmin 1+zmin
4. Shear (in x and y) so that the direction of projection is 0 0 −1 0
aligned with the z axis.
∗ .
• Nper = M Nper
5. Scale into the canonical view volume (truncated pyramid).
Clipping and projection to 2D The whole process
• Clipping is usually carried out in the canonical view volume since • To summarise the process of 2D viewing of 3D objects is:
the algorithm will be independent of the projection type.
– 3D → homogeneous,
• Projecting the 3D canonical volumes to 2D is very simple, we – apply Npar or Nper ,
just retain the x and y coordinates.
– homogeneous → 3D,
• The matrix to do this is just: – clip,
1 0 0 0 1 0 0 0
0 1 0 0 0 1 – 3D → homogeneous,
0 0
Mort = or Mper = .
0 0 0 0 0 0 0 0 – project using Mort or Mper ,
0 0 0 1 0 0 −1 1
– transform into device coordinates (window to viewport):
homogeneous → 2D.
Summary