Skip to content

Fix zooming by forcing the use of the scale in the Canvas' Camera - #2032

Merged
loichuder merged 2 commits into
mainfrom
fix-zoom
Aug 5, 2026
Merged

Fix zooming by forcing the use of the scale in the Canvas' Camera#2032
loichuder merged 2 commits into
mainfrom
fix-zoom

Conversation

@loichuder

@loichuder loichuder commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fix #2028

As I foresaw, the issue stemmed from mrdoob/three.js#32805 that removes the scale when computing matrixWorldInverse of the Camera.

It seems using scales in the matrix (even more so non-uniform scales) is unsupported in some parts of Threejs (mrdoob/three.js#26659 (comment)), leading to problems when computing lightning for example (mrdoob/three.js#26659 (comment)).

I'd like to say this is not relevant for us but the discussion at mrdoob/three.js#26659 worries me a bit: perhaps our use of scale to implement non-uniform zooming is actually more a bug than a feature of three.js. To be discussed with @t20100 perhaps.

Anyway, in this PR, I make a quickfix by creating a new camera that computes matrixWorldInverse as three was doing it before v0.183 and it fixes the issue.

enableBigIntSerialization();

failOnConsole();
failOnConsole({

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to ignore this deprecation warning since it is only fixed in R3F v10: pmndrs/react-three-fiber#3741

@loichuder
loichuder requested a review from axelboc August 4, 2026 13:09
Base automatically changed from update-readme-peer-deps to main August 4, 2026 15:12

@axelboc axelboc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@loichuder
loichuder merged commit cc41d48 into main Aug 5, 2026
13 checks passed
@loichuder
loichuder deleted the fix-zoom branch August 5, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

three 0.183.0 breaks the zooming

2 participants