3D skew transformation matrix along one coordinate axis

前端 未结 1 1245
天命终不由人
天命终不由人 2021-02-06 10:52

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

1条回答
  •  深忆病人
    2021-02-06 11:20

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

    0 讨论(0)
提交回复
热议问题