Viewing Parameters View plane plane of our display

  • Slides: 20
Download presentation
Viewing Parameters • View plane: plane of our display surface • View reference point

Viewing Parameters • View plane: plane of our display surface • View reference point (VRP): center of attention, all other viewing parameters are expressed relative to this point • View plane normal (VPN): look direction • View distance: distance from camera to VRP • View-up direction: vector pointing to top of camera • View plane coordinates: film coordinates • object coordinates: coordinates that the objects lie 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 1

Viewing Parameters 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 2

Viewing Parameters 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 2

Conversion to View Plane Coordinates • We wish to perform a series of transformations

Conversion to View Plane Coordinates • We wish to perform a series of transformations which will change the object coordinates into the view plane coordinates. • First step: translate the origin to the correct position for the view plane coordinate system (shifting to VRP then shifting along the VPN by the VIEW-DISTANCE. • Second step: align the z axis 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 3

3 D Rotation about an Arbitrary Axis. 1 Translate the axis to origin. 2

3 D Rotation about an Arbitrary Axis. 1 Translate the axis to origin. 2 Rotate about x until the axis of rotation is in the xz plane. 3 Rotate about y axis until the z axis corresponds to the axis of rotation. 4 Rotate about z (axis of rotation (. 5 Reverse the rotation about y. 6 Reverse the rotation about x. 7 Reverse the translation 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 4

Graphical Illustrations 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 5

Graphical Illustrations 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 5

Mathematical Illustrations • Suppose the rotation axis is defined by a point (x 1,

Mathematical Illustrations • Suppose the rotation axis is defined by a point (x 1, y 1, z 1) and a vector [A B C], so the line equations are x = Au + x 1 y = Bu + y 1 z = Cu + z 1 • The initial translation matrix and its reverse translation are 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 6

Mathematical Illustrations • Rotation about x axis y , 0)B, C( V = (B

Mathematical Illustrations • Rotation about x axis y , 0)B, C( V = (B 2+C 2)1/2 sin(I) = B/V cos(I) = C/V y )A, B, C( , 0)B, C( B V x x C z 3/12/2021 I z 240 -422 Computer Graphics : Viewing in 3 D_4 7

Mathematical Illustrations • Rotation matrix, Rx • Reverse matrix, Rx-1 3/12/2021 240 -422 Computer

Mathematical Illustrations • Rotation matrix, Rx • Reverse matrix, Rx-1 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 8

Mathematical Illustrations • Rotation about y y A J L x V z 3/12/2021

Mathematical Illustrations • Rotation about y y A J L x V z 3/12/2021 L = (A 2+B 2+C 2)1/2 V = (L 2 -A 2)1/2=(B 2+C 2)1/2 sin(J) = A/L cos(J) = V/L Rotation axis 240 -422 Computer Graphics : Viewing in 3 D_4 9

Mathematical Illustrations • Rotation matrix, Ry • Reverse matrix, Ry-1 3/12/2021 240 -422 Computer

Mathematical Illustrations • Rotation matrix, Ry • Reverse matrix, Ry-1 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 10

Mathematical Illustrations • Rotation about the z axis • The actual transformation for a

Mathematical Illustrations • Rotation about the z axis • The actual transformation for a rotation about an arbitraty axis is given by R = T-1 Rx-1 Ry-1 Rz Ry Rx T 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 11

Back to “View Plane Coordinates Conversion” • Parameters: VPR = (xr, yr, zr( VPN

Back to “View Plane Coordinates Conversion” • Parameters: VPR = (xr, yr, zr( VPN = [Nx, Ny, Nz[ View-up = [xup, yup, zup[ View-distance = VD • The entire transformation is TMATRIX = Rz Ry Rx T 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 12

Mathematical Illustrations V=(Ny 2 + Nz 2)1/2 3/12/2021 240 -422 Computer Graphics : Viewing

Mathematical Illustrations V=(Ny 2 + Nz 2)1/2 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 13

Mathematical Illustrations 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 14

Mathematical Illustrations 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 14

Clipping in 3 D • Clipping against planes, not against lines as in 2

Clipping in 3 D • Clipping against planes, not against lines as in 2 D Front plane clipping Back plane clipping Top plane clipping Bottom plane clipping Left plane clipping Right plane clipping Clipping Process 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 15

3 D Clipping • Fig 8 -38, 8 -39, 8 -40 3/12/2021 240 -422

3 D Clipping • Fig 8 -38, 8 -39, 8 -40 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 16

3 D Clipping 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 17

3 D Clipping 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 17

Front and Back Clipping • for the point (x 1, y 1, z 1)

Front and Back Clipping • for the point (x 1, y 1, z 1) to be visible : z 1<= FRONT-Z 3/12/2021 and z 1 >= BACK-Z 240 -422 Computer Graphics : Viewing in 3 D_4 18

3 D Viewing Transformation Summary. 1 Draw object in the object coordinates. 2 Specify

3 D Viewing Transformation Summary. 1 Draw object in the object coordinates. 2 Specify viewing parameter (VPR, VPN, VD, etc(. . 3 Convert object coordinates to view plane coordinates. 4 Perform 3 D clipping. 5 Project the objects in viewing onto the view plane 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 19

3 D Application: Flight Simulator • Fig 8 -45, 8 -46 3/12/2021 240 -422

3 D Application: Flight Simulator • Fig 8 -45, 8 -46 3/12/2021 240 -422 Computer Graphics : Viewing in 3 D_4 20