should make axis rotation matrix1ms ‣
const axis = [0.5, 0.6, -0.7];
const angle = 1.23;
let x = axis[0];
let y = axis[1];
let z = axis[2];
const n = Math.sqrt(x * x + y * y + z * z);
x /= n;
y /= n;
z /= n;
const xx = x * x;
const yy = y * y;
const zz = z * z;
const c = Math.cos(angle);
const s = Math.sin(angle);
const oneMinusCosine = 1 - c;
const expected = [
xx + (1 - xx) * c,
x * y * oneMinusCosine + z * s,
x * z * oneMinusCosine - y * s,
0,
x * y * oneMinusCosine - z * s,
yy + (1 - yy) * c,
y * z * oneMinusCosine + x * s,
0,
x * z * oneMinusCosine + y * s,
y * z * oneMinusCosine - x * s,
zz + (1 - zz) * c,
0,
0, 0, 0, 1,
];
testMat4WithAndWithoutDest((newDst) => {
return mat4.axisRotation(axis, angle, newDst);
}, expected);