It’s because of a float precision problem.
Matrices store their components as 32 bits float and not 64 bits.
For testing purpose, I have performed some changes on my local copy to have matrices use 64 bits float instead (so Array instead of Float32Array), and it’s much better, even if not exactly equal:
2.8306351045,0.0000001191,0.0000001154,-0.0000000000,-0.0000005523,0.4227937602,
0.0000005524,-0.0000000000,-43670253748.5334472656,42674406020.9739761353,
43208142962.6059951782,-0.5000044421,43670305807.5326919556,-42674456892.8302230835,
-43208194469.7262496948,0.5000050381
2.8306352408,-0.0000000142,-0.0000000195,0.0000000000,0.0000000046,0.4227932161,
0.0000000015,0.0000000000,-43670199647.2177734375,42674353153.3738937378,
43208089433.7807312012,-0.5000038226,43670251706.1525268555,-42674404025.1671066284,
-43208140940.8371810913,0.5000044187
I don’t see an easy solution here, as I don’t think updating the Matrix
class to use 64 bits floats is planned… Maybe having an option to switch matrices to 64 bits could do it, but that would mean quite a lot of work to make all code depending on matrices work in both cases…