13

I'm looking for skew algorithm, just like on photoshop, edit->transform->skew is there any simple matrix which could do that?

what I've seen so far was basic skew matrix (shear) but its lack of control point, doesn't like on photoshop which have at least 4 points on each corner of rectangle and we can move each control point freely.

I need to implement it to transform a plane.

  • See [this question](http://stackoverflow.com/questions/169902/projective-transformation) on quadrilateral mapping. – plinth Mar 23 '09 at 13:32

1 Answers1

26

Looking at http://www.w3.org/TR/SVG11/coords.html, which talks about SVG, it says:

  • A skew transformation along the x-axis is equivalent to the matrix

alt text

or [1 0 tan(a) 1 0 0], which has the effect of skewing X coordinates by angle a.

  • A skew transformation along the y-axis is equivalent to the matrix

alt text

or [1 tan(a) 0 1 0 0], which has the effect of skewing Y coordinates by angle a.

Hope that helps! :)

Community
  • 1
  • 1
Seb
  • 24,920
  • 5
  • 67
  • 85
  • These matricies are what mathematicians call skew, but based on http://www.offshorewebsolution.com/resources/creating_skew_effects_in_adobe_photoshop.html, I'm don't think it's what Photoshop calls skew. – David Norman Mar 23 '09 at 12:56
  • Yep, those matrices are affine transformations, we look here for projective ones. – Alexandre C. Mar 24 '11 at 11:26