-
-
Notifications
You must be signed in to change notification settings - Fork 86
Line Render order & orthographic camera min/max fixes #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
69ba4be
b1732ac
50ac207
4340229
53e304c
ab85078
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -283,7 +283,18 @@ export const CameraControls: FC< | |||||||||||||||||
| ? ThreeCameraControls.ACTION.ZOOM | ||||||||||||||||||
| : ThreeCameraControls.ACTION.DOLLY; | ||||||||||||||||||
| } | ||||||||||||||||||
| }, [disabled, mode]); | ||||||||||||||||||
|
|
||||||||||||||||||
| // For orthographic cameras, use distance parameters as zoom limits | ||||||||||||||||||
| if (isOrthographic && cameraRef.current) { | ||||||||||||||||||
| // Convert distance to zoom values (inverse relationship) | ||||||||||||||||||
| cameraRef.current.maxZoom = maxDistance | ||||||||||||||||||
| ? 50000 / minDistance | ||||||||||||||||||
| : undefined; | ||||||||||||||||||
| cameraRef.current.minZoom = minDistance | ||||||||||||||||||
| ? 50000 / maxDistance | ||||||||||||||||||
|
||||||||||||||||||
| ? 50000 / minDistance | |
| : undefined; | |
| cameraRef.current.minZoom = minDistance | |
| ? 50000 / maxDistance | |
| ? 50000 / maxDistance | |
| : undefined; | |
| cameraRef.current.minZoom = minDistance | |
| ? 50000 / minDistance |
Outdated
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 50000 is used for zoom calculations without explanation. Consider extracting this as a named constant with a descriptive comment explaining its purpose in the distance-to-zoom conversion formula.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AntonJames-Sistence Should we allow modification of this constant? Maybe better to add this as props with a default value to have the ability to change it if needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SerhiiTsybulskyi we can modify maxDistance/minDistance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I think I need a better idea for this min/max zoom, because it actually doesn't work as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SerhiiTsybulskyi I had to add min/max zoom props, since there's no actual correlation between zoom and dolly, as I thought in the beginning