1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

3D version of tmtogl_transpose

This commit is contained in:
Zeno Rogue 2019-10-28 17:19:30 +01:00
parent 33f17e345a
commit f3035bb1f5

View File

@ -172,6 +172,18 @@ EX glmatrix tmtogl_transpose(const transmatrix& T) {
return tmp;
}
EX glmatrix tmtogl_transpose3(const transmatrix& T) {
glmatrix tmp;
for(int i=0; i<4; i++)
for(int j=0; j<4; j++)
tmp[i][j] = T[j][i];
if(MDIM == 3)
for(int i=0; i<4; i++)
for(int j=0; j<4; j++)
if(i == 3 || j == 3) tmp[j][i] = 0;
return tmp;
}
EX glmatrix ortho(ld x, ld y, ld z) {
return scale(1/x, 1/y, 1/z);
}