xeokit / xeokit-xkt-utils

Deprecated JavaScript tools to generate .XKT files; replaced by https://github.com/xeokit/xeokit-convert
Other
11 stars 9 forks source link

Fix misaligned objects in distantly-positioned models #9

Closed xeolabs closed 3 years ago

xeolabs commented 3 years ago

In XKT 6, some objects become misaligned when their coordinates are far from the origin.

Screenshot from 2021-03-18 10-16-09

Solution

This is due to an accumulation of rounding errors within the XKT 6 conversion logic, caused by some code that was wrongly using a single-precision transformation matrix, where it should have used double-precision.

This is now fixed in XKT 7, where we just made sure we were using double-precision matrices for everything.