Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transformations Szirmay-Kalos László. Transformations Can destroy our equations Limit the transformations and the shapes and require invariance – Line.

Similar presentations


Presentation on theme: "Transformations Szirmay-Kalos László. Transformations Can destroy our equations Limit the transformations and the shapes and require invariance – Line."— Presentation transcript:

1 Transformations Szirmay-Kalos László

2 Transformations Can destroy our equations Limit the transformations and the shapes and require invariance – Line (segment), plane (polygon) Affine transformations – Preserve lines and parallelism – Linear in Cartesian coordinates (x,y) (x’,y’) = T(x,y) Homogenous linear transformations Preserve lines Linear in homogeneous coordinates x’ = a 11 x + a 21 y + a 31 y’ = a 12 x + a 22 y + a 32

3 Perspective

4 Team of Computer Graphics Ideal point

5 Euclidean  Projective plane Euclid’s axioms: Two points define a line. A line has at least two points. If a is a line and A is a point not on this line, then there is exactly one other line that crosses point A but not line a. Axioms of projective geometry: Two points define a line. A line has at least two points. Two lines intersect in a single point. 

6 Homogenous coordinates (2D) XhXh YhYh w (0,0) (1,0) (0,1) r[X h,Y h,h] = X h  (1,0)+Y h  (0,1)+w  (0,0) h r[X h,Y h,h] = (, ) XhhXhh YhhYhh x = XhhXhh YhhYhh y = (x, y)  [x, y, 1]  [x  h, y  h, h]= [X h, Y h, h] h= X h +Y h +w

7 Homogeneous coordinates in ideal points: h=0 x y [x,y,1] [2x,2y,1]  [x,y,1/2] [x,y,1/3] [x,y,0] Euclidean plane + ideal points = projective plane Ideal point

8 Homogenous coordinates (3D) YhYh ZhZh w Total weight: h = X h +Y h +Z h +w Center of mass: [X h,Y h,Z h,h] XhXh All cannot be simultaneously zero x = XhhXhh YhhYhh y = ZhhZhh z =

9 Line in projective space X1X1 Y1Y1 w1w1 line = combination of two points segment = convex combination of two points [X(t),Y(t),Z(t),h(t)]=[X 1,Y 1,Z 1,h 1 ]·t +[X 2,Y 2,Z 2,h 2 ]·(1-t)

10 Euclidean space, Cartesian coordinates: n x x + n y y + n z z + d = 0 Euclidean space, homogeneous coordinates: n x X h /h + n y Y h /h + n z Z h /h +d = 0 Projective space: n x X h + n y Y h + n z Z h +d h = 0 [X h,Y h,Z h,h]· = 0 nxnynzdnxnynzd Plane h0h0 h0h0 × (r – r0)  n = 0 y n z x r0r0 r

11 Homogeneous linear transformations Matrix-vector multiplication 2D transformation: 3x3 matrix [X h ’,Y h ’,h ’ ] =[X h,Y h,h]·T 3x3 3D transformation: 4x4 matrix [X h ’,Y h ’,Z h ’,h ’ ] = [X h,Y h,Z h,h]·T 4x4 Concatenation of transformations: Associativity [X h ’,Y h ’,Z h ’,h ’ ]=(...([X h,Y h,Z h,h]·T 1 )·T 2 )...T n ) = = [X h,Y h,Z h,h]·(T 1 ·T 2 ·... ·T n ) = = [X h,Y h,Z h,h]·T

12 Affine transformations l Last column is [0,0,1] T or [0,0,0,1] T l Linear in Cartesian coordinates l Preserves lines and parallelism [x’,y’,1] = [x,y,1] a 11 a 12 0 a 21 a 22 0 a 31 a 32 1 x’ = a 11 x + a 21 y + a 31 y’ = a 12 x + a 22 y + a 32

13 Rows of affine transformations (x’, y’) = o + xu + yv u x u y 0 v x v y 0 o x o y 1 [x’,y’,1]=[x,y,1]  u v o  x,y) (x’,y’) [0, 0, 1] [o x o y 1 ] [1, 0, 1] [o x +u x o y +u y 1 ] [0, 1, 1] [o x +v x o y +v y 1 ]

14 Properties of invertible homogeneous linear transformations Lines to lines, convex combinations to convex combinations Lines to lines: [X(t),Y(t),Z(t),h(t)]=[X 1,Y 1,Z 1,h 1 ]·t + [X 2,Y 2,Z 2,h 2 ]·(1-t) P(t) = P 1 ·t + P 2 ·(1-t)// · T P*(t) = P(t)·T = (P 1 ·T)·t + (P 2 ·T)·(1-t)

15 Invertible homogeneous linear transformations: Planes to planes P·N T = 0 T P P* = P·T T -1 (P*·T -1 )·N T = 0 P*·(T -1 ·N T ) = 0 P*·N* T = 0 N*=N · (T -1 ) T Inverse transpose

16 Translation (x’, y’, z’)=(x+p x, y+p y, z+p z ) [x’,y’,z’,1] = [x,y,z,1] 10 0 0 0 1 0 0 0 0 1 0 p x p y p z 1 p

17 Scaling x’=S x  x, y’=S y  y, z’=S z  z [x’,y’,z’,1] = [x,y,z,1] S x 0 0 0 0 S y 0 0 0 0 S z 0 0 0 0 1

18 Rotation around axis Z x = r cos  y = r sin  x’ = r cos(  = r cos  cos  r sin  sin  y’ = r sin(  = r cos  sin  r sin  cos  x’ = r cos(  = x  cos  y  sin  y’ = r sin(  = x  sin  y  cos  [x,y] [x’,y’]   r cos  sin  -sin  cos      [x’,y’,z’,1] = [x,y,z,1] z’= z

19 Rotation around axis z

20 Rotation around a line crossing the origin and of direction w: Rodrigues formula w : axis of rotation, let it be unit vector w  r  = w  r  r r || = w(r  w)= r’ || r=r-w(rw)r=r-w(rw) r’r’ r’= r’ || +r’  r’=w(r  w)+(r-w(r  w))cos(  )+w  r sin(  ) = r cos(  )+w(r  w)(1-cos(  ))+w  r sin(  ) Rows of the matrix: apply for i, j,k

21 Central projection(2D) 1  0 p 0 1 q 0 0 0 [x, y, 1] [x, y, px+qy] x px+qy y px+qy x, y x’, y’ px+qy=1 x/y=x’/y’ és 

22 Wrap around problem =Projective line (topology) Ideal point Line segment ?????


Download ppt "Transformations Szirmay-Kalos László. Transformations Can destroy our equations Limit the transformations and the shapes and require invariance – Line."

Similar presentations


Ads by Google