3D skew transformation matrix along one coordinate axis

…衆ロ難τιáo~ 提交于 2019-12-20 14:32:31

问题


Is there a way to calculate the skew transformation matrix along one coordinate axis, given the skew angle, as follows


回答1:


This should work for the most part for skewing an object with a transformation matrix, in particular using glMultMatrix(matrix)

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
};


来源:https://stackoverflow.com/questions/13206220/3d-skew-transformation-matrix-along-one-coordinate-axis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!