1 / 19

Tutorial 1

Tutorial 1. Course Outline Homogeneous Coordinates. Matrix Multiplication Rule. Matrices make linear transformations of vectors. Translation, Scaling, Rotation of Vectors. Translation in Homogeneous coordinates. Now, we can write the translation as the multiplication by

dpurdy
Download Presentation

Tutorial 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tutorial 1 Course Outline Homogeneous Coordinates Tutorial 1

  2. Matrix Multiplication Rule Matrices make linear transformations of vectors Tutorial 1

  3. Translation, Scaling, Rotation of Vectors Tutorial 1

  4. Translation in Homogeneous coordinates Now, we can write the translation as the multiplication by specially designed matrix: Translation Tutorial 1

  5. Sequential Translations in Homogeneous Coordinates We can check that the matrix representing two sequential translations can be written as the multiplication of their matrices. Two translations Tutorial 1

  6. Scaling in Homogeneous coordinates Scaling matrix looks similar to what it was for ordinary coordinates: Scaling What is the Matrix for Scaling 0.1x1 and 10x2 ? Tutorial 1

  7. Several Scalings in Homogeneous coordinates The matrix of two successful scalings is the multiplication of two scaling matrices: Two scalings What is the Matrix for Scaling 0.1x1 and 10x2 and then 20x1 and 0.1x2? Tutorial 1

  8. Rotation in Homogeneous coordinates Easy to check, that clock-wise rotation on angle θ is given by: Rotation Two successful rotations can be represented by multiplication of their matrices: Two Rotations Tutorial 1

  9. x2 x1 W3 W2 W1 Scaling of Homogeneous coordinates Homogeneous coordinates scaled by a constant, represent the same point. Tutorial 1

  10. Scaling of Homogeneous coordinates Tutorial 1

  11. Rotation around arbitrary point How to write the rotation around a point ? Bring the point p to the origin; make a rotation, bring it back: Bring p back Bring p to the origin Rotation … the same procedure for scaling: Bring p back Bring p to the origin Scaling Tutorial 1

  12. Example 1. Series of transformations 1). Write down the matrix for: Rotation θ=90° around p=(2,5), translation (-2,2), scaling (x2) around p=(-1,1). Rotation Translation Scaling ( T(-1,1)·S(2,2)·T(1,-1) ) ·T(-2,2) ·( T(2,5) ·R(90) ·T(-2,-5) ) Tutorial 1

  13. Homogeneous coordinates in 3D The translation and scaling are very similar in 3D: Point Translation Scaling Tutorial 1

  14. Rotation in 3D: Axis needed The Rotation in 3D can be done around arbitrary axis. Eulerangles representation. Any rotation is the composition of three basic rotation, a rotation around the axis x of an angle q, a rotation around the axis y of an angle j and a rotation around the angle z of an angle y. q, j, y are called Euler angles In right hand coordinated these rotations are defined as follows • Simple representation • Order-dependent:  • Not suitable for animation, because the interpolation between the angles of rotation leads to false locations Tutorial 1

  15. Examples 2,3. Rotations in 3D 2). Rotation θ=90° around x followed by rotation θ=90° around y. find the axis of rotation. R=R1·R2; If c – rotation axis, then: Rc=c; Solve v.r.t c; c=(a,a,-a,1) 3). Prove that rotation is not commutative: Rx(θ1)·Ry(θ2)≠ Ry(θ2) ·Rx(θ1) Tutorial 1

  16. Lines in Homogeneous Coordinates The line equation in Euclidian Coordinates is: The Euclidian point (x,y) in Homogeneous Coordinates can be written as p=(x,y,1) or p=(αx, αy, α) Therefore, denoting Euclidian line (1) by the homogeneous triple u=(a,b,c) we obtain, that the point p lies on the line u iff: For example, point p=(1,2,1) lies on the line y=x+1 which can be written by u=(1,-1,1) Tutorial 1

  17. Intersection of two lines 1/2 Now, let us look for the interception point p=(x, y, w) of two lines u1=(a1,b1,c1) andu2=(a2,b2,c2): Form the first equation: Substituting this into the second: Taking convenient choice of scaling, in which Tutorial 1

  18. Intersection of two lines 2/2 We obtain On the other hand, writing formally We have showed, that the point p of the intersection of two lines u1 and u2 is described by Tutorial 1

  19. Three points on the line Now, let us look for the line u=(a, b, c) passing through two points p1=(x1,y1,w1) andp2=(x2,y2,w2): Similarly to the solution of the lines intersection, we obtain The third point p3=(x3,y3,w3) lies on the line u if (p3,u)=0, which via definitions of determinant can be written as Due to duality of representation of lines and points in Homogeneous Coordinates, if the three lines u1, u2 and u3 intersect in a single point, they satisfy Tutorial 1

More Related