ol3d
ol3d copied to clipboard
Support Matrix
- [x] Translate
- [x] Scale
- [x] Rotate
- [ ] LookAt
- [ ] Orthographic
- [x] Perspective
http://blog.csdn.net/zujack/article/details/52460227 https://www.jianshu.com/p/bfc8327eaad3
和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];
}
http://learnopengl-cn.readthedocs.io/zh/latest/01%20Getting%20started/08%20Coordinate%20Systems/