forked from 1b-agent/opencadstudio-upstream
A drawing placed at UTM shimmered as the camera moved. The relative-to-eye path exists so the large eye translation never enters an f32 matrix, and it zeroed the translation column to make sure. But the basis was built first, by `look_at(eye, target)` with both positions cast to f32 — and at (639792, 4517057) that grid is half a metre across in y. Rounding both ends and then subtracting them left a direction that changed as the camera moved, so the whole view basis jittered. Zeroing the translation afterwards came too late to help: the damage was in the rotation. It never needed the positions. The eye is `target + rotation·Z·distance`, so the direction between them is the rotation's own Z — a unit vector carrying no coordinate at all. Two tests. Where the camera stands must not reach the matrix, which is the property being restored; and at the origin, where the old construction had no large coordinates to lose, the two must agree exactly — which is what says this kept the same basis rather than turning the view round. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>