沿一个坐标轴的3D倾斜变换矩阵

时间:2012-11-03 05:20:49

标签: matrix angle skew

有没有办法在给定倾斜角度的情况下沿一个坐标轴计算倾斜变换矩阵,如下所示

enter image description here

1 个答案:

答案 0 :(得分:11)

这应该在很大程度上用于使用变换矩阵来扭曲对象,特别是使用glMultMatrix(矩阵)

enter image description here

matrix1[] = {
1,  0,  0,  0,
tan(a), 1,  0,  0,
0,  0,  1,  0,
0,  0,  0,  1
};

matrix2[] = {
    1,  0,  0,  0,
    0,  1,  0,  0,
    tan(a), 0,  1,  0,
    0,  0,  0,  1
};

matrix3[] = {
    1,  tan(a), 0,  0,
    0,  1,  0,  0,
    0,  0,  1,  0,
    0,  0,  0,  1
};

matrix4[] = {
    1,  0,  0,  0,
    0,  1,  0,  0,
    0,  tan(a), 1,  0,
    0,  0,  0,  1
};

matrix5[] = {
    1,  0,  tan(a), 0,
    0,  1,  0,  0,
    0,  0,  1,  0,
    0,  0,  0,  1
};

matrix6[] = {
    1,  0,  0,  0,
    0,  1,  tan(a), 0,
    0,  0,  1,  0,
    0,  0,  0,  1
};