3 D Viewing Process Modeling Coordinates World Coordinates

  • Slides: 14
Download presentation
3 -D Viewing Process Modeling Coordinates World Coordinates Modeling transformation Viewing transformation 2 -D

3 -D Viewing Process Modeling Coordinates World Coordinates Modeling transformation Viewing transformation 2 -D Fall 2004 3 -D Viewing Coordinates Projection transformation Projection Coordinates Workstation transformation CS-321 Dr. Mark L. Hornick Device/Window Coordinates 1

Viewing Coordinate System Identify viewer position relative to scene Viewer “looks through” a window

Viewing Coordinate System Identify viewer position relative to scene Viewer “looks through” a window Must specify position and view direction Fall 2004 CS-321 Dr. Mark L. Hornick 2

View Plane yv ym xv zv zm xm N View plane defined by normal

View Plane yv ym xv zv zm xm N View plane defined by normal vector (N) Fall 2004 CS-321 Dr. Mark L. Hornick 3

View Reference Points ym zm Pr yv P 0 xm xv zv N •

View Reference Points ym zm Pr yv P 0 xm xv zv N • Pr: a point in the scene we are looking at • P 0: a vantage point from which we’re looking • Note Pr, P 0, and N are expressed in xmymzm Fall 2004 CS-321 Dr. Mark L. Hornick 4

ym V ym xm xm V Look-Up Vector zm zm View-plane normal vector and

ym V ym xm xm V Look-Up Vector zm zm View-plane normal vector and reference point are not enough We also need to specify orientation of view(er) View-up vector (V) must be normal to N Fall 2004 CS-321 Dr. Mark L. Hornick 5

Viewing Coordinates N, V form a right hand system. ym V yv P 0

Viewing Coordinates N, V form a right hand system. ym V yv P 0 zv N Pr zm Fall 2004 xv xm Viewing coordinate system based on vectors V, N Forms the (xv, yv, zv) coordinate axes CS-321 Dr. Mark L. Hornick 6

Viewing Coordinates yv l, m, n form a right hand system. ym V m

Viewing Coordinates yv l, m, n form a right hand system. ym V m P 0 xv zv N, n Pr zm L, l xm Note V and m are not necessarily parallel. Fall 2004 CS-321 Dr. Mark L. Hornick 7

Changing Views (1) Maintain Pr, change N ym P r N N zm xm

Changing Views (1) Maintain Pr, change N ym P r N N zm xm N Fall 2004 CS-321 Dr. Mark L. Hornick 8

Changing Views (2) Maintain N, change Pr and P 0 Pr ym P r

Changing Views (2) Maintain N, change Pr and P 0 Pr ym P r Pr xm zm P 0 Fall 2004 N P 0 N CS-321 Dr. Mark L. Hornick P 0 N 9

View to Model Transformation • Expresses the position & orientation of xvyvzv with respect

View to Model Transformation • Expresses the position & orientation of xvyvzv with respect to xmymvm • Allows us to transform coordinates from view frame to model frame • But we want just the opposite… Fall 2004 CS-321 Dr. Mark L. Hornick 10

Model to View Transformation • • • Fall 2004 The inverse of the view

Model to View Transformation • • • Fall 2004 The inverse of the view to model transformation produces the model to view transformation Expresses the position & orientation of xmymzm with respect to x v yv vv Allows us to transform coordinates from model frame to view frame CS-321 Dr. Mark L. Hornick 11

View to Device Transformation • The view to device transformation expresses the position and

View to Device Transformation • The view to device transformation expresses the position and orientation of the view coordinate system w. r. t. the device coordinate system. • Allows us to transform coordinates from view frame to device/window frame. • Incorporates parameters that specify the offset of the view frame w. r. t. the upper-left corner of the screen, as well as the fact that the view frame is rotated 180 about the x-axis w. r. t. the device frame. Fall 2004 CS-321 Dr. Mark L. Hornick 12

Model to Device Transformation • • Fall 2004 The model to device transformation expresses

Model to Device Transformation • • Fall 2004 The model to device transformation expresses the position and orientation of the model coordinate system w. r. t. the device coordinate system This is simply the compound transformation of model to view, followed by view to device CS-321 Dr. Mark L. Hornick 13

Model Coordinates to Device Coordinates • Using the compound model to device transformation, the

Model Coordinates to Device Coordinates • Using the compound model to device transformation, the coordinates of a point v in the model coordinate frame can be transformed into coordinates in the device/window frame • Scaling factor s can also be applied via a 3 -D scaling matrix S Fall 2004 CS-321 Dr. Mark L. Hornick 14