Presentation is loading. Please wait.

Presentation is loading. Please wait.

Viewing Transformations

Similar presentations


Presentation on theme: "Viewing Transformations"— Presentation transcript:

1 Viewing Transformations
CS5600 Computer Graphics by Rich Riesenfeld 5 March 2002 Lecture Set 11 CS5600

2 Homogeneous Coordinates
An infinite number of points correspond to (x,y,1). They constitute the whole line (tx,ty,t). (tx,ty,t) w = 1 (x,y,1) CS5600

3 Illustration: Old Style, Simple Transformation Sequence for 3D Viewing
CS5600 CS5600

4 Simple Viewing Transformation Example
Points A B C D E F G H X -1 1 Y Z CS5600 CS5600

5 Simple Cube Viewed from (6,8,7.5)
H=(-1,-1,1) E=(-1,1,1) F=(1,1,1) G=(1,-1,1) D=(-1,-1,-1) A=(-1,1,-1) C=(1,-1,-1) B=(1,1,-1) CS5600

6 Topology of Cube A B C D E F G H 1 B C E H D F G A CS5600 CS5600

7 Topology of Cube A: B D E B: A C F C: G D: H E: F: G: H: H E G F D A C
CS5600 CS5600

8 Simple Example Give a Cube with corners
View from Eye Position (6,8,7.5) Look at Origin (0,0,0) “Up” is in z-direction CS5600 CS5600

9 Translate Origin by (6,8,0) CS5600 CS5600

10 Simple Viewing Transformation Example
CS5600 CS5600

11 Build LH Coord with (6,8,0) CS5600 CS5600

12 Build LH Coord with CS5600 CS5600

13 Rotate about y with 6 10 (6,8,0) 8 CS5600 CS5600

14 Simple Viewing Transformation Example
CS5600 CS5600

15 Rotate about x-axis with
7.5 10 CS5600 CS5600

16 Look at the (3-4-5) Right Triangle
10 (4) 7.5 (3) (5) 12.5 CS5600 CS5600

17 Simple Viewing Transformation Examle
CS5600 CS5600

18 View on 10x10 screen, 20 away 20 10 10 CS5600 CS5600

19 Map to canonical frustum
20 20 CS5600 CS5600

20 Scale x,y by 2 for normalization
Will view a 20”x20” screen from 20” away. Scale to standard viewing frustum. CS5600 CS5600

21 Simple Viewing Transformation Example
CS5600 CS5600

22 Clipping not needed, so project
CS5600 CS5600

23 Transformation of Cube
CS5600 CS5600

24 Cube Transformed for Viewing
Pts A B C D E F G H X 2.8 -0.4 -2.8 0.4 Y -1.84 -3.28 -1.36 .08 1.36 -.08 1.84 3.28 Z 12.94 11.98 13.26 14.22 11.74 10.78 12.06 13.02 CS5600 CS5600

25 Transformed Cube G=(-2.8,1.84) E=(2.8,1.36) F=(-0.4,-.08) D=(0.4,.08)
Pt X Y A 2.8 -1.84 B -0.4 -3.28 C -2.8 -1.36 D 0.4 08 E 1.36 F -.08 G 1.84 H 3.28 H=(0.4,3.28) G=(-2.8,1.84) E=(2.8,1.36) F=(-0.4,-.08) D=(0.4,.08) A: B D E B: A C F C: G D: H E: F: G: H: C=(-2.8,-1.36) A=(2.8,-1.84) B=(-0.4,-3.28) 25 CS5600

26 Recall mapping [a,b] [-1,1]
Translate center of interval to origin Normalize interval to [-1,1] CS5600 CS5600

27 Recall mapping [a,b] [-1,1]
Substitute x =a: x CS5600 CS5600

28 Recall mapping [a,b] [-1,1]
Substitute x =b: x CS5600 CS5600

29 Map to the (1K x 1K) screen Assume screen origin (0,0) at lower left. This translates old (0,0) to center of screen (511,511). CS5600 CS5600

30 Map to the (1K x 1K) screen Proper scale factor for mapping:
CS5600 CS5600

31 Combine Screen Transformation
CS5600 CS5600

32 For General Screen: …… CS5600 CS5600

33 Transformation to Std Clipping Frustum
CS5600 CS5600

34 Transforming to Std Frustum
CS5600 CS5600

35 Transforming to Std Frustum
CS5600 CS5600

36 Transforming to Std Frustum
The right scale matrix to map to canonical form CS5600 CS5600

37 Transforming to Std Frustum
CS5600 CS5600

38 Determining Rotation Matrix
CS5600

39 Frame rotation, CS5600 CS5600

40 Inverse problem easy, CS5600 CS5600

41 In matrix representation of ,
Columns are simply images of CS5600 CS5600

42 Rotation matrix M columns given by frame’s pre-image Column i of is
CS5600 CS5600

43 Inverse of rotation matrix M
Recall, for rotation matrix R, So, CS5600 CS5600

44 Rotation matrix M Row i is simply Simply write M down! Thus, CS5600

45 Frame Rotation: CS5600 CS5600

46 46 CS5600

47 47 CS5600

48 48 CS5600

49 49 CS5600

50 50 CS5600

51 51 CS5600

52 52 CS5600

53 The End of Viewing Transformations
Lecture Set 11 53 CS5600


Download ppt "Viewing Transformations"

Similar presentations


Ads by Google