Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There actually is a way to do what you're trying to do using just the ie matrix transformation filter. </p> <p>in addition to M11, M12, M21, M22, the matrix also has two additional properties: Dx and Dy for translation. Unfortunately, you can't just translate by a constant amount. In order to rotate about the center of the object, you need to compose three transformation. </p> <p>First, translate the center of the object to the origin. Second, rotate the object. Third, translate from the origin back to where the center belongs. </p> <p>IE does not have the ability to compose multiple matrices itself, so you have to do the linear algebra yourself. Suppose theta is the angle by which you want to rotate, and suppose that the object's width is 2w while its height is 2h. (So w and h are the HALF width and height respectively.) Let c and s stand for cos(theta) and sin(theta) respectively.</p> <p>The matrix product you want to compute is then:</p> <pre><code> [[1 0 w] [[c -s 0] [[1 0 -w] [0 1 h] [s c 0] [0 1 -h] [0 0 1]] [0 0 1]] [0 0 1]] </code></pre> <p>which equals:</p> <pre><code> [[ c -s (-wc + hs + w)] [ s c (-ws - hc + h)] [ 0 0 1 ]] </code></pre> <p>So, if you compute the two quantities (-wc + hs + w) and (-ws -hc + h) and add them to your filter as Dx and Dy respectively, the end result will be that the rotation is about the center of the object. </p> <p>I have coded this up and tested it for a project in which I needed to animate having an object rotate about its center, and this worked for me. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload