Skip to main content
Participant
April 16, 2012
Answered

What are skewX and skewY in Motion XML?

  • April 16, 2012
  • 1 reply
  • 1056 views

In the motion XML, what is skewX and skewY? The spec says "shearing along X" and "shearing along Y". However, according to my research, equal shearing along X and Y does not result in rotation(although that's what the spec says about skewX and skew Y)

Can skewX and skewY be represented by a transformation matrix? If so, what is it?

This topic has been closed for replies.
Correct answer _spoboyle

Well, the docs in question are here. The passage in question is this:

skewXNumberThe angle (in degrees) of shearing along the horizontal axis. If the skewX and skewY values are equal, they are replaced by the rotation attribute.

And indeed, in the XML animations I have exported, I'd have a rotation of, say 60deg in one keyframe, followed by one with no rotation but skewX and skewY both close to 60deg and then another one with only rotation, all other attributes(like scale) not really changing, also, there is not a single keyframe with both skew and rotation.

Furthermore, in some animations, an image that is mirrored along the Y axis is represented using a skewY of 180deg. Given the transform matrix above, that just wouldn't work. also, that meshes well with the "equal skewX and skewY means rotation" because mirroring along both X and Y is equivalent to a rotation of 180deg.

All the docs I could find on the internet show the matrix you posted for shearing, however that doesn't seem to work with flash's concept of "skew". Hence, my question.


do believe all your answers are here

http://www.senocular.com/flash/tutorials/transformmatrix/

in particular if you search for this "Play around with a movie clip's transform matrix and watch how the transformation is applied" without the quote you will come across an interactive swf that lets you play around with skewing etc. Hopefully this will explain what skewing is.

also i found that if you increase c (x skew) and decrease b (y skew) to the same amount you will in fact get your rotation.

my transformation matrices for skewing still stand

1 reply

_spoboyle
Inspiring
April 16, 2012

Mathematically, a skew can be represented in 2D by

[1 b 0]

[c 1 0]

[0 0 1]

where b and c are skew factors. c is a xSkew and b a ySkew.

a combination of an xSkew and ySkew with equal values will not result in a rotation. can you link to the documentation that says it does?

_spoboyle
Inspiring
April 16, 2012

more info

Rotation is actually a result of a combination of scaling and skewing. Together, scaling and skewing can distort coordinates to provide a rotation.

note a scale is represented by

[a 0 0]

[0 d 0]

[0 0 1]

where a is an xScale an d is a yScale.

and this leads us to a roation means we must modify a, b, c, d

and is in fact represented by

[ cos   sin  0]

[-sin   cos  0]

[  0      0   1]


r_entropyAuthor
Participant
April 16, 2012

Well, the docs in question are here. The passage in question is this:

skewXNumberThe angle (in degrees) of shearing along the horizontal axis. If the skewX and skewY values are equal, they are replaced by the rotation attribute.

And indeed, in the XML animations I have exported, I'd have a rotation of, say 60deg in one keyframe, followed by one with no rotation but skewX and skewY both close to 60deg and then another one with only rotation, all other attributes(like scale) not really changing, also, there is not a single keyframe with both skew and rotation.

Furthermore, in some animations, an image that is mirrored along the Y axis is represented using a skewY of 180deg. Given the transform matrix above, that just wouldn't work. also, that meshes well with the "equal skewX and skewY means rotation" because mirroring along both X and Y is equivalent to a rotation of 180deg.

All the docs I could find on the internet show the matrix you posted for shearing, however that doesn't seem to work with flash's concept of "skew". Hence, my question.