偏斜矩阵算法 [英] skew matrix algorithm
问题描述
我正在寻找偏斜算法,就像在photoshop上一样,编辑->变换->偏斜有没有简单的矩阵可以做到这一点?
I'm looking for skew algorithm, just like on photoshop, edit->transform->skew is there any simple matrix which could do that?
到目前为止我看到的是基本的倾斜矩阵(剪切),但它缺乏控制点,不喜欢在矩形的每个角上至少有 4 个点的 photoshop,我们可以自由移动每个控制点.
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.
推荐答案
查看 http://www.w3.org/TR/SVG11/coords.html,关于SVG,它说:
Looking at http://www.w3.org/TR/SVG11/coords.html, which talks about SVG, it says:
- 沿 x 轴的偏斜变换等效于矩阵
或[1 0 tan(a) 1 0 0],具有将X坐标倾斜角度a的效果.
or [1 0 tan(a) 1 0 0], which has the effect of skewing X coordinates by angle a.
- 沿 y 轴的偏斜变换等效于矩阵
或 [1 tan(a) 0 1 0 0],具有将 Y 坐标倾斜角度 a 的效果.
or [1 tan(a) 0 1 0 0], which has the effect of skewing Y coordinates by angle a.
希望有帮助!:)
这篇关于偏斜矩阵算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!