Projections and Viewing Transformations Graphics & - - PowerPoint PPT Presentation

projections and viewing
SMART_READER_LITE
LIVE PREVIEW

Projections and Viewing Transformations Graphics & - - PowerPoint PPT Presentation

Graphics & Visualization Chapter 4 Projections and Viewing Transformations Graphics & Visualization: Principles & Algorithms Chapter 4 Introduction In computer graphics there are: 3D models 2D


slide-1
SLIDE 1

Graphics & Visualization

Chapter 4

Projections and Viewing Transformations

Graphics & Visualization: Principles & Algorithms Chapter 4

slide-2
SLIDE 2

Graphics & Visualization: Principles & Algorithms Chapter 4 2

  • In computer graphics there are:

 3D models  2D output devices (displays and printers)

  • Projective mapping (projection):

 Must take place at some point in the graphics pipeline  Usually after the culling stages and before the rendering stage

  • Viewing transformation:

 Defines the transition from the world coordinate

system (WCS) to canonical screen system (CSS) via the eye coordinate system (ECS)

 Specifies the clipping bounds (for frustum culling)

in ECS

Introduction

slide-3
SLIDE 3

Graphics & Visualization: Principles & Algorithms Chapter 4 3

  • All objects are initially defined in their own local coordinate system
  • These objects are unified in WCS
  • The WCS is essentially used to define the model of a 3D synthetic

world

  • The transition from WCS to ECS:

 Simplifies a number of operations including culling (e.g. the specification of

the clipping bounds by the user) and projection

  • The transition from ECS to CSS:

 Ensures that all objects that survived culling will be defined in a canonical

space (usually [-1,1])

  • Objects defined in a canonical space:

 Can easily be scaled to the actual coordinates of any display device or monitor  Maintain high floating-point accuracy

Coordinate Systems

slide-4
SLIDE 4

Graphics & Visualization: Principles & Algorithms Chapter 4 4

  • Projection: techniques for the creation of the image of an object
  • nto another simpler object (e.g. line, plane, surface)
  • Projection lines are defined by:

 Center of projection  Points on the image being projected

  • The intersection of a projector with the simpler object (e.g. the plane
  • f projection) forms the image of a point of the original object.
  • Projections can be defined in spaces of arbitrary dimension.
  • In Computer Graphics & Visualization:

 Projections are from 3D space onto 2D space  The 2D space is referred to as the plane of projection & models the output

device

Projections

slide-5
SLIDE 5

Graphics & Visualization: Principles & Algorithms Chapter 4 5

  • Two projections are of interest:

 Perspective: the distance of the center of projection from the plane of

projection is finite

 Parallel: the distance of the center of projection from the plane of

projection is infinite

  • Projective mappings are not affine transformations, so they cannot

be described by affine transformation matrices. Differences between affine transformations and projective mappings:

Projections(2)

slide-6
SLIDE 6

Graphics & Visualization: Principles & Algorithms Chapter 4 6

  • Parallel lines: are not projected onto parallel lines

their projections seem to meet at a vanishing point

  • Parallel lines are projected onto parallel lines only when their plane

is parallel to the plane of projection

  • A straight line will map to a straight line

Example:

  • Ratios of distances are not preserved:
  • Cross ratios are preserved:
  • To fully describe the projective image of a line we need the image of

3 points on the line (affine transformations need only 2)

Projections(3)

     ab a b bd b d          ac a c cd c d ab a b bd b d

slide-7
SLIDE 7

Graphics & Visualization: Principles & Algorithms Chapter 4 7

  • Models the viewing system of our eyes
  • Can be abstracted by a pinhole camera:

 Center of projection: the pinhole  Plane of projection: the image plane (where the image is formed)  Creates an inverted image  Derive an upright image by placing the image ‘in front’ of the pinhole

Perspective Projection

slide-8
SLIDE 8

Graphics & Visualization: Principles & Algorithms Chapter 4 8

  • Suppose that:

 Center of projection is the origin  Plane of projection is perpendicular to the

negative z-axis at distance d from the center

  • A point P = [x, y, z]T is projected onto P΄ = [x΄, y΄, d]T
  • P1 and P1΄ are the projections of P and P΄ onto the yz-plane
  • are similar so:
  • Similarly :
  • The above are not linear equations (division by z)

Perspective Projection (2)

and  

1 2 1 2

OP P OP P · y y d y y d z z          

1 2 1 2 2 2

P P P P OP OP

· d x x z  

slide-9
SLIDE 9

Graphics & Visualization: Principles & Algorithms Chapter 4 9

  • Trick to express the perspective-projection equations in matrix form:

Use matrix which alters the homogeneous coordinate and maps the coordinates of a point [x, y, z]T as follows:

  • Divide by the homogeneous coordinate:

Perspective Projection (3)

1 d d d             

PER

P

· · · · 1 x x d y y d z z d z                         

PER

P

· · · · / · 1 x d x d z y d y d z z z d d z                               

slide-10
SLIDE 10

Graphics & Visualization: Principles & Algorithms Chapter 4 10

  • Perspective shortening:

 The size of the projection of an object is inversely proportional to its distance

from the center of projection

  • Known in ancient times, then forgotten
  • Leonardo da Vinci studied the laws of perspective
  • Older paintings had no perspective (symbolic criteria prevailed)

Perspective Projection (4)

slide-11
SLIDE 11

Graphics & Visualization: Principles & Algorithms Chapter 4 11

  • Center of projection is at infinite distance from the projection plane
  • Projection lines are parallel to each other
  • To describe parallel projection one must specify:

 The direction of projection (a vector)  The plane of projection

  • Two types of parallel projections:

 Orthographic: the direction of projection is normal to the plane

  • f projection

 Oblique: the direction of projection is not necessarily normal to

the plane of projection

Parallel Projection

slide-12
SLIDE 12

Graphics & Visualization: Principles & Algorithms Chapter 4 12

  • Usually employs one of the main planes as the plane of projection
  • Suppose the xy-plane is used
  • A point P = [x, y, z]T will be projected onto P΄ = [x΄,y΄,z΄]T =[x,y,0] T

as follows: where

Orthographic Projection

·  

ORTHO

P P P

1 1 1             

ORTHO

P

slide-13
SLIDE 13

Graphics & Visualization: Principles & Algorithms Chapter 4 13

  • Let the direction of projection be:

and the plane of projection be the xy-plane

  • The projection P΄ = [x΄,y΄,z΄]T of a point P = [x, y, z]T will be

(1) for some scalar λ

  • The z-coordinate of P΄ is 0, so (1) becomes:
  • The other 2 coordinates of P΄ are:

Oblique Projection

[ , , ]T

x y z

DOP DOP DOP  DOP

·     P P DOP

·

  • r

z z

z z DOP DOP      

· · and ·

y x x z z

DOP DOP x x DOP x z y y z DOP DOP         

slide-14
SLIDE 14

Graphics & Visualization: Principles & Algorithms Chapter 4 14

  • Matrix form:
  • Oblique Projection (2)

1 1 ( ) 1

x z y z

DOP DOP DOP DOP                     

OBLIQUE

P DOP

( )·  

OBLIQUE

P P DOP P

slide-15
SLIDE 15

Graphics & Visualization: Principles & Algorithms Chapter 3 15

EXAMPLE 1: Perspective Projection of a Cube Determine the perspective projections of a cube

  • f side 1 when

(a)the plane of projection is z=-1 and (b)the plane of projection is z=-10. The cube is placed on the plane of projection. SOLUTION (a)

  • Represent the vertices of the cube as a 4×8 matrix:

Projection Example 1

1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 1 1 1 1 1 1 1 1                      C

slide-16
SLIDE 16

Graphics & Visualization: Principles & Algorithms Chapter 3 16

  • Multiply the perspective projection matrix (d=-1) by C:
  • Normalize by the homogeneous coordinates:

Projection Example 1 (2)

1 1 1 1 1 1 1 1 1 1 · · 1 1 1 1 1 2 2 2 2 1 1 1 1 1 2 2 2 2                                             

PER

P C C

1 1 1 1 2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1                          

slide-17
SLIDE 17

Graphics & Visualization: Principles & Algorithms Chapter 3 17

(b) The original cube is:

  • Multiply the perspective projection matrix (d=-10) by C’:
  • Normalize by the homogeneous coordinates:

Projection Example 1 (3)

1 1 1 1 1 1 1 1 10 10 10 10 11 11 11 11 1 1 1 1 1 1 1 1                       C

10 10 10 10 10 10 10 10 10 10 · 10 100 100 100 100 110 110 110 110 1 10 10 10 10 11 11 11 11                                              C

10 10 1 1 11 11 10 10 1 1 11 11 10 10 10 10 10 10 10 10 1 1 1 1 1 1 1 1                          

slide-18
SLIDE 18

Graphics & Visualization: Principles & Algorithms Chapter 3 18

EXAMPLE 2: Perspective Projection onto an Arbitrary Plane Compute the perspective projection of a point P=[x, y, z]T onto the arbitrary plane Π which is specified by the point R0=[x0,y0,z0]T and a normal vector . The center of projection is O. SOLUTION

  • P΄=[x ΄, y ΄, z ΄]T is the projection of P=[x, y, z]T
  • are collinear so

for some scalar a

  • In the projection equations:

(1) scalar a must be determined.

Projection Example 2

[ , , ]T

x y z

n n n  N

and  OP OP · a   OP OP

' , ' , ' x ax y ay z az   

slide-19
SLIDE 19

Graphics & Visualization: Principles & Algorithms Chapter 3 19

  • Vector is on the plane of projection, so :
  • Substitute the values of x, y, z from (1), set c = nx x0 + ny y0 + nz z0 and

solve for a:

  • The projection equations include a division by a combination of x,y,z
  • Put in matrix form by altering the homogeneous coordinate:

Projection Example 2 (2)

 R P

· ( ) ( ) ( )

x y z x y z x y z

N

  • r n x

x n y y n z z

  • r n x

n y n z n x n y n z                    R P

x y z

c a n x n y n z   

, x y z

c c c n n n

              

PER

P

slide-20
SLIDE 20

Graphics & Visualization: Principles & Algorithms Chapter 3 20

EXAMPLE 3: Oblique projection with Azimuth & Elevation Angles Sometimes (particularly in architectural design), oblique projections are specified in terms of the azimuth and elevation angles φ and θ that define the relation of the direction to the plane of projection. Determine the projection matrix in this case. SOLUTION

  • Let xy be the plane of projection
  • The direction of the projection vector is:
  • So:

Projection Example 3

[cos cos ,cos sin ,sin ]T       DOP

cos 1 tan sin 1 ( , ) tan 1                           

OBLIQUE

P

slide-21
SLIDE 21

Graphics & Visualization: Principles & Algorithms Chapter 3 21

EXAMPLE 4: Oblique projection onto an Arbitrary Plane Determine the oblique projection mapping onto an arbitrary plane Π that is specified by a point R0=[x0,y0,z0]T and a normal vector . The direction of projection is given by the vector SOLUTION Transform plane Π to coincide with the xy-plane, use the oblique projection matrix, undo the first transform:

  • Step 1: Translate R0 to the origin,
  • Step 2: Align with the positive z-axis (by using from[Ex 3.12])
  • Step 3: Use the oblique projection matrix with the direction of

projection transformed according to previous steps:

Projection Example 4

[ , , ]T

x y z

DOP DOP DOP  DOP

[ , , ]T

x y z

n n n  N

( )  T R

N

( ) A N

( )· ( )·

 

 DOP A N T R DOP

slide-22
SLIDE 22

Graphics & Visualization: Principles & Algorithms Chapter 3 22

  • Step 4: Undo the alignment
  • Step 5: undo the translation
  • Finally:

Projection Example 4 (2)

( )1 A N

( ) T R

, (

) ( )· ( ) · ( )· ( )· ( )

  

 

1 OBLIQUE OBLIQUE

P DOP T R A N P DOP A N T R

slide-23
SLIDE 23

Graphics & Visualization: Principles & Algorithms Chapter 4 23

  • Defines:

 the process of coordinate conversion:  The clipping boundaries (for frustum culling) in ECS

(Right-handed coordinate systems)

  • Viewing Transformation: a. WCS-to-ECS conversion
  • b. ECS-to-CSS conversion

orthographic projections  perspective projections

  • z-coordinate is maintained by the ECS-to-CSS conversion

 Stages following VT (e.g. hidden surface elimination) require 3D

information

Viewing Transformation (VT)

slide-24
SLIDE 24

Graphics & Visualization: Principles & Algorithms Chapter 4 24

  • ECS can be defined within the WCS by:

 The ECS origin E  The direction of view  The up direction

  • The origin E represents the point of view (location of an observer)
  • The vector

 defines the up direction  need not be perpendicular to

  • WCS to ECS conversion steps:
  • 1. Define the ECS axes xe, ye and ze
  • 2. Perform the WCS-to-ECS conversion for all objects

WCS to ECS

g

up up

g

slide-25
SLIDE 25

Graphics & Visualization: Principles & Algorithms Chapter 4 25

  • 1. Define the ECS axes
  • Sufficient information (E, , ) since the coordinate system is

right-handed

  • Align xe- and ye-axes with the WCS axes with the convention:

xe is the horizontal axis & increases to the right

ye is the vertical axis & increases upwards

ze-axis points towards the observer (right-handed ECS)

Compute xe- and ye-axes as cross products:

WCS to ECS (2)

g

up

   

e e e e e

x up z y z x

 

e

z g

slide-26
SLIDE 26

Graphics & Visualization: Principles & Algorithms Chapter 4 26

  • 2. WCS-to-ECS conversion

i. Establish matrix ii. Pre-multiply all object vertices by it

  • From [Ex. 3.16] this conversion requires 2 transformations:

Translation by

Change of basis (rotational transformation)

  • Let the WCS coordinates of the ECS unit axis vectors be:
  • Then:

WCS to ECS (3)

 WCS ECS

M

[ , , ]

T x y z

E E E   E

[ , , ] , [ , , ] and [ , , ]

T T T x y z x y z x y z

a a a b b b c c c   

e e e

x y z

1 1 · 1 1 1

x y z x x y z y x y z z

a a a E b b b E c c c E

                           

WCS ECS

M

slide-27
SLIDE 27

Graphics & Visualization: Principles & Algorithms Chapter 4 27

  • Orthographic projection onto the xy-plane:

Select a region of space (view volume) that will be mapped to CSS

rectangular parallelepiped

can be defined by 2 opposite vertices

xe = l, the left clip plane

xe = r, the right clip plane, (r > l)

ye = b, the bottom clip plane

ye = t, the top clip plane, (t > b)

ze = n, the near clip plane

ze = f , the far clip plane, ( f < n, since the ze axis points toward the observer)

ECS to CSS: Orthographic projection

slide-28
SLIDE 28

Graphics & Visualization: Principles & Algorithms Chapter 4 28

  • To maintain the z-coordinate use the ortho. proj. MORTHO = ID
  • Converting the view volume into CSS:

Translation & Scaling

Map the (l, b, n) values to -1 and (r, t, f) values to 1

  • Thus a WCS point Xw = [xw, yw, zw]T is mapped into CSS by:

ECS to CSS: Orthographic projection(2)

2 2 2 ( , , )· ( , , )· 2 2 2 2 2 1 2 2 2 1 · 2 2 2 1 2 1 1 1 r l t b n f r l t b f n r l r l r l r l r l t b t b t b t b t b n f n f f n f n f n

                                                                              

ORTHO ECS CSS

M S T ID              

· ·

 

ORTHO s ECS CSS WCS ECS w

X M M X

slide-29
SLIDE 29

Graphics & Visualization: Principles & Algorithms Chapter 4 29

  • View volume is a truncated pyramid, symmetrical about the
  • ze axis
  • This view volume is specified by:

 θ , the angle of the field of view in the y-direction  aspect, the width to height ratio of a cross section of the pyramid  ze = n, the near clipping plane  ze = f , the far clipping plane ( f < n)

ECS to CSS: Perspective projection

slide-30
SLIDE 30

Graphics & Visualization: Principles & Algorithms Chapter 4 30

  • Projection takes place onto the near clipping plane ze = n
  • Compute the other clipping boundaries:
  • Use a modified version of the

perspective projection matrix:

  • z-coordinate :

Preserve it for hidden surface & other computations in screen space

Simply keeping ze will deform objects

Use a mapping that preserves lines & planes zs = A + B / ze , where A,B are constants

ECS to CSS: Perspective projection (2)

top: | |·tan( ) 2 bottom:

  • right:

· left:

  • t

n b t r t aspect l r         

1 d d d             

PER

P

slide-31
SLIDE 31

Graphics & Visualization: Principles & Algorithms Chapter 4 31

  • Require that (ze = n)  (zs = n) and (ze = f )  (zs = f ) so

A = ( n + f ) and B = -nf

  • This mapping will not alter the boundaries ze = n , ze = f

but this will not be true for ze values between them

  • Thus the perspective projection matrix is:

Makes the w-coordinate equal to ze

Must be followed by a division by ze (perspective division)

Clipping boundaries are not affected

Transforms the truncated pyramid into a rectangular parallelepiped :

ECS to CSS: Perspective projection (3)

1 n n n f nf               

VT

P

slide-32
SLIDE 32

Graphics & Visualization: Principles & Algorithms Chapter 4 32

  • Situation similar to the setting before the orthographic projection
  • This view volume is already symmetrical about the –ze axis
  • ECS-to-CSS conversion steps:
  • 1. PVT
  • 2. translation along ze
  • 3. scaling

ECS to CSS: Perspective projection (4)

2 2 2 ( , , )· (0,0, )· 2 2 1 2 1 · · 0 1 2 2 1 1 1 n f r l t b f n r l n n t b n f n f nf f n

                                                              

PERSP ECS CSS VT

M S T P 2 2 2 1 n r l n t b n f nf f n f n                          

slide-33
SLIDE 33

Graphics & Visualization: Principles & Algorithms Chapter 4 33

  • Thus a WCS point Xw = [xw, yw, zw]T is converted into CSS by:

followed by the perspective division by w (= ze)

  • Frustum culling is performed before the perspective division

ensuring that the coordinates of every point on every object are within the clipping bounds:

  • w ≤ x, y, z ≤ w
  • The coordinates of every point are now in the range [-1,1]

ECS to CSS: Perspective projection (5)

· · x y z w

 

            

PERSP ECS CSS WCS ECS w

M M X

/ x y w z w             

s

X

slide-34
SLIDE 34

Graphics & Visualization: Principles & Algorithms Chapter 4 34

Example:

  • Take the boundary points with ECS coordinates

[l, b, n, 1]T and [0, 0, f, 1]T

  • Apply the PVT matrix:
  • The homogeneous coordinate is no longer 1
  • Apply the scaling & translation matrices:

ECS to CSS: Perspective projection (6)

2 2

· · 1 1 l ln b bn n n f f n f                                                  

VT VT

P P

2 2

· · · · ln n bn n n n f f n n f f                                                      S T S T

slide-35
SLIDE 35

Graphics & Visualization: Principles & Algorithms Chapter 4 35

Example(continued):

  • Due to the symmetry of the truncated pyramid about –ze :

r = -l, t = -b so r - l = -2l, t - b = -2b

  • Perspective division:

which are the CSS values of the points

ECS to CSS: Perspective projection (7)

1 1 / / 1 1 1 1 n n n f n f n f                                                        

slide-36
SLIDE 36

Graphics & Visualization: Principles & Algorithms Chapter 4 36

  • A. Truncated Pyramid Not Symmetrical about ze-Axis

e.g. stereo viewing where two viewpoints are slightly offset on the xe –axis

Extended Viewing Transformation

slide-37
SLIDE 37

Graphics & Visualization: Principles & Algorithms Chapter 4 37

  • A. Truncated Pyramid Not Symmetrical about ze-Axis
  • Parameters of the clipping planes:

 ze = n0, the near clipping plane (as before)  ze = f0, the far clipping plane, f0 < n0 (as before)  ye = b0, the ye-coordinate of the bottom clipping plane at its

intersection with the near clipping plane

 ye = t0, the ye-coordinate of the top clipping plane at its intersection

with the near clipping plane

 xe = l0, the xe-coordinate of the left clipping plane at its intersection

with the near clipping plane

 xe = r0, the xe-coordinate of the right clipping plane at its intersection

with the near clipping plane

Extended Viewing Transformation(2)

slide-38
SLIDE 38

Graphics & Visualization: Principles & Algorithms Chapter 4 38

  • A. Truncated Pyramid Not Symmetrical about ze-Axis (steps)
  • Convert the non-symmetrical pyramid to symmetrical about ze with a shear

transformation on the xy-plane

(1)

  • Determine the A, B parameters

Take the shear on the y-coordinate: map the midpoint of t0b0 to 0

Similarly for the xe shear factor:

  • So (1) becomes:

Extended Viewing Transformation(3)

1 1 1 1 A B             

xy

SH

· 2 2 b t b t B n B n       

2 l r A n   

1 2 1 2 1 1 l r n b t n

                      

NON SYM

SH

slide-39
SLIDE 39

Graphics & Visualization: Principles & Algorithms Chapter 4 39

  • A. Truncated Pyramid Not Symmetrical about ze-Axis (steps)
  • Change the clipping boundaries, to reflect the symmetrical shape of

the new pyramid:

  • Substitute the above into

which is equivalent to the original with the clipping bounds replaced by the initial clipping bounds.

Extended Viewing Transformation(4)

2 2 2 2 n n f f l r l r l l r r b t b t b b t t              

 PERSP ECS CSS

M

2 2 2 1 n r l n t b n f n f f n f n

                            

PERSP ECS CSS

M

 PERSP ECS CSS

M

slide-40
SLIDE 40

Graphics & Visualization: Principles & Algorithms Chapter 4 40

  • A. Truncated Pyramid Not Symmetrical about ze-Axis
  • Thus it is not necessary to have initial clipping bounds; can name

them n, f, l, r, b, t from the start.

  • The ECSCSS mapping in the case of non-symmetrical

perspective projection is thus:

Extended Viewing Transformation(5)

2 1 2 2 1 · · 2 2 1 1 1 n l r r l n n b t t b n n f nf f n f n

    

                                                 

PERSP NON SYM PERSP ECS CSS ECS CSS NON SYM

M M SH 2 2 2 1 n l r r l r l n b t t b t b n f nf f n f n                                 

slide-41
SLIDE 41

Graphics & Visualization: Principles & Algorithms Chapter 4 41

  • B. Oblique Projection
  • Useful, e.g., in the computation of oblique views for 3D displays:

is not sufficient

Direction of projection must be taken into account

  • View volume: a six-sided parallelepiped specified by:

The 6 parameters used for the non-symmetrical pyramid (n0, f0, l0, r0, b0, t0)

The direction of projection vector

  • Steps:

1. Translate the view volume so that (l0, b0, n0)-point moves to the ECS origin 2. Perform a shear in the xy-plane

Extended Viewing Transformation(6)

 ORTHO ECS CSS

M

DOP

slide-42
SLIDE 42

Graphics & Visualization: Principles & Algorithms Chapter 4 42

  • B. Oblique Projection (steps)
  • Take the point defined by the origin and

Shear the (DOPy) coordinate to 0:

Similarly for the x-shear factor:

  • The required transformation is:
  • Alter the clipping bounds to reflect the new rectangular parallelepiped

n = 0, f = f0 - n0, l = 0, r = r0 - l0, b = 0, t = t0 - b0

  • ECSCSS mapping for a general parallel projection is thus:

Extended Viewing Transformation(7)

[ , , ]T

x y z

DOP DOP DOP  DOP

·

y y z z

DOP DOP B DOP B DOP     

x z

DOP A DOP  

1 1 1 1 · · 0 1 1 1 1

x z y z

DOP DOP l DOP b DOP n                                    

PARALLEL PARALLEL

SH T

· ·

 

PARALLEL ORTHO ECS CSS ECS CSS PARALLEL PARALLEL

M M SH T

slide-43
SLIDE 43

Graphics & Visualization: Principles & Algorithms Chapter 4 43

  • Frustum culling:

Eliminates primitives (parts or whole) that lie outside the view volume(frustum)

Is implemented by 3D clipping algorithms

  • The viewing transformation defines the 3D clipping boundaries.
  • Clipping takes place in CSS, after the application of or

but before the division by w.

  • Clipping boundaries for: perspective projection: -w ≤ x, y, z ≤ w
  • rthographic or parallel projection: -1 ≤ x, y, z ≤ 1
  • Why clip in 3D and not in 2D, after throwing away z?

In perspective projection, objects behind the center of projection E would appear upside-down (no sufficient information in clipping)

Avoids possible perspective division by 0

The near and far clipping planes limit the depth range & enable the optimal allocation of the bits of the depth buffer

Frustum Culling & the Viewing Transformation

 PERSP ECS CSS

M

 ORTHO ECS CSS

M

slide-44
SLIDE 44

Graphics & Visualization: Principles & Algorithms Chapter 4 44

  • Viewport: rectangular part of the screen where the contents
  • f the view volume are displayed.
  • Defined by its bottom-left and top-right corners

[xmin, ymin]T and [xmax, ymax]T in pixel coordinates

[xmin, ymin, zmin]T and [xmax, ymax, zmax]T to maintain the z-coordinate

  • Viewport transformation converts objects from CSS into the

viewport coordinate system (VCS) with a scaling & a translation:

  • This is a generalization of the 2D window-to-viewport transformation [Ex. 3.8].
  • The size of the viewport defines the final size of the objects on screen

The Viewport Transformation

1 2 2 2 2 1 · 2 2 2 2 1 2 2 1 1

min max max min max min min max min max max min max min min max min max max min max min

x x x x x x x x y y y y y y y y z z z z z z

                                                    

VIEWPORT CSS VCS

M 2 2 1

min max

z z                     