Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transformational Geometry CS418 Computer Graphics John C. Hart.

Similar presentations


Presentation on theme: "Transformational Geometry CS418 Computer Graphics John C. Hart."— Presentation transcript:

1 Transformational Geometry CS418 Computer Graphics John C. Hart

2 Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion

3 2-D Points Represents points and vertices as column vectors: (-1,-1) (1,1)

4 2-D Points Represents points and vertices as column vectors: Transform polygonal object by transforming its vertices (-1,-1) (1,1)

5 2-D Points Represents points and vertices as column vectors: Transform polygonal object by transforming its vertices Scale by matrix multiplication (-1,-1) (1,1)

6 2-D Points Represents points and vertices as column vectors: Transform polygonal object by transforming its vertices Scale by matrix multiplication Translation via vector sum (-1,-1) (1,1)

7 2-D Points Represents points and vertices as column vectors: Transform polygonal object by transforming its vertices Scale by matrix multiplication Translation via vector sum Order is important –Translate then scale –Scale then translate (-1,-1) (1,1)

8 Homogeneous Coordinates Translation by vector sum is cumbersome Add a extra coordinate –Called the homogeneous coordinate –For now, set to one Translation now expressed as a matrix Now we can compose scales and translations into a single matrix by matrix multiplication

9 Order Dependence (-1,-1)

10 Window-to-Viewport (-1,-1) (1,1) (0,0) (w-1,h-1) W2V First translate lower-left corner to (0,0) Then scale upper-right corner from (2,2) to (w-1,h-1) To get

11 2-D Rotation Pick a point (x,y)

12 2-D Rotation Pick a point (x,y) Assume polar coords x = r cos , y = r sin 

13 2-D Rotation Pick a point (x,y) Assume polar coords x = r cos , y = r sin  Rotate about origin by  x’ = r cos  + , y’ = r sin  + 

14 2-D Rotation Pick a point (x,y) Assume polar coords x = r cos , y = r sin  Rotate about origin by  x’ = r cos  + , y’ = r sin  +  Recall trig. identities x’ = r (cos  cos  –sin  sin  ) y’ = r (sin  cos  +cos  sin  )

15 2-D Rotation Pick a point (x,y) Assume polar coords x = r cos , y = r sin  Rotate about origin by  x’ = r cos  + , y’ = r sin  +  Recall trig. identities x’ = r (cos  cos  –sin  sin  ) y’ = r (sin  cos  +cos  sin  ) Rearrange terms x’ = cos  (r cos  ) – sin  (r sin  ) y’ = (r cos  ) sin  + (r sin  ) cos 

16 2-D Rotation x’ = cos  (r cos  ) – sin  (r sin  ) y’ = (r cos  ) sin  + (r sin  ) cos 

17 2-D Rotation x’ = cos  (r cos  ) – sin  (r sin  ) y’ = (r cos  ) sin  + (r sin  ) cos  x x y y

18 Squash & Stretch From: John Lasseter: “Principles of Traditional Animation Applied to 3-D Computer Animation” Proc. SIGGRAPH 87

19 Luxo Jr.

20

21

22

23

24

25

26

27

28

29 Squash Scale one coordinate by matrix multiplication

30 Arbitrary Squash Squash in arbitrary direction –Rotate direction into x –Squash in x –Rotate back

31 Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion Screen Vertices Model Vertices


Download ppt "Transformational Geometry CS418 Computer Graphics John C. Hart."

Similar presentations


Ads by Google