ol3d icon indicating copy to clipboard operation
ol3d copied to clipboard

Support Matrix

Open but0n opened this issue 6 years ago • 3 comments

  • [x] Translate
  • [x] Scale
  • [x] Rotate
  • [ ] LookAt
  • [ ] Orthographic
  • [x] Perspective

but0n avatar Jan 21 '18 09:01 but0n

http://blog.csdn.net/zujack/article/details/52460227 https://www.jianshu.com/p/bfc8327eaad3

image

和WebGL相反, ol3d使用行主序(Row major), 左乘

void ol3d_matrix_multi_v3(ol3d_Vector3_t *a, ol3d_matrix_t b) {
    ol3d_matrix_t temp = {a->x, a->y, a->z, 1};
    ol3d_matrix_t result;
    for(unsigned char i = 0; i < 4; i++) {
        result[i] = ol3d_matrix_multi_chunk(temp, b, i);
    }
    a->x = result[0];
    a->y = result[1];
    a->z = result[2];
}

but0n avatar Feb 22 '18 05:02 but0n

http://learnopengl-cn.readthedocs.io/zh/latest/01%20Getting%20started/08%20Coordinate%20Systems/

but0n avatar Apr 19 '18 14:04 but0n