沿一个坐标轴的3D偏斜变换矩阵 [英] 3D skew transformation matrix along one coordinate axis

查看:106
本文介绍了沿一个坐标轴的3D偏斜变换矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法可以在给定偏斜角的情况下沿一个坐标轴计算偏斜变换矩阵,如下所示:

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

推荐答案

这在大部分情况下都可以用于通过转换矩阵来倾斜对象,特别是使用glMultMatrix(matrix)

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

这篇关于沿一个坐标轴的3D偏斜变换矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆