Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D skew transformation matrix along one coordinate axis

Tags:

matrix

angle

skew

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

enter image description here

like image 592
rraallvv Avatar asked Nov 03 '12 05:11

rraallvv


1 Answers

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

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
};
like image 101
rraallvv Avatar answered Nov 08 '22 15:11

rraallvv