有没有办法在给定倾斜角度的情况下沿一个坐标轴计算倾斜变换矩阵,如下所示
答案 0 :(得分:11)
这应该在很大程度上用于使用变换矩阵来扭曲对象,特别是使用glMultMatrix(矩阵)
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
};