Presentation is loading. Please wait.

Presentation is loading. Please wait.

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators.

Similar presentations


Presentation on theme: "Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators."— Presentation transcript:

1 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators

2 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 This Chapter: we will learn Vectors Representing vertices Matrix Representing transformation operators Review Translation/Scale/Rotation Examine D3D Implementation

3 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Vertex position and Row Vector Vertex, V, at (x,y) V = (x, y) Represent as a row vector

4 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Translation means moving Operator: Moves vertex: To: We represent: Translation Operator:

5 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Translation Example: Operator: Vertex: Result:

6 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Translation: Properties Moves relative Relation of input/output points maintains

7 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Translating entire object:

8 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Translation Properties Geometric: does not change shape: Size, edges, and angles between angles Reversibility Identity: T(0,0) Extension to 3D: simple

9 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Note on order of operation True for ALL operators: T, S, R is different from In fact: with row vector representation is undefined!

10 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 scaling means change size Operator: scales vertex: To: We represent: Scaling Operator:

11 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Scaling Example: Operator: Vertex: Result:

12 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Scaling stretches distance (from axes) Operator: Individual points Groups of points

13 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Scaling entire object

14 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Reflection: Negative scaling factors Negative factor in x: Reflect across y Negative factor in y: Reflect across x

15 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Reflection: entire object

16 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Scaling Properties Geometric: scale factors scale distances to the axes. Reversibility Identity: S(1,1) Extension to 3D: simple

17 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Rotation means turning Operator: Moves vertex: To: We represent: Rotation Operator:

18 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Rotation Example: Operator: Vertex: Result:

19 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Rotation: Fixed distance from Origin Move along circumference Distance between points do not change

20 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Rotating entire object:

21 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Rotation Properties Geometric: Shape and area does not change Reversibility Identity: R(0) Extension to 3D: tricky! Will study in detailed in later chapter

22 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Summary: operators

23 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 A Word about vectors … Vertex position: Row Vector Column Vector (Transpose)

24 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 A Word about Matrices 4x4 array of floats

25 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Operators: Translate and Scale

26 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Rotation Operators: About Z-axis About Y-axis About X-axis

27 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Identify Matrix Does not do any thing! M is a matrix MI = M and IM = M Important matrix for initialization!

28 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Order of operation is important! Precedence of operation is not important! Some properties of Matrices

29 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Matrices and Vectors Row vector: To translate by T: Column vector: To translate by T:

30 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Row vs. Column Vectors One should never mix row and column vector representation We use Row representation exclusively! Operator always appear on the right side of the vector! Referred to as: Post multiplying a vector

31 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Direct 3D Matrix Processors: Three matrix processors in RC All vertex V operated on by all three:

32 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Initialize Matrix Processors

33 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Lib8: Changes Rectangle: RectXY DrawHelper Support for Rectangle

34 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Lib8: Utilities (minimum changes)

35 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Lib8:

36 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Tutorial 8.1: the WORLD Matrix

37 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Tut 8.1: Transformation … Matrix Processors: Vertex ( ) is transformed by:

38 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Tut 8.2: Per Primitive Transform

39 Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Tutorial: 8.3 & 8.4: Scale/Rotate


Download ppt "Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators."

Similar presentations


Ads by Google