Repository navigation
Fix 3D preview: stop bump-size flicker and free up X rotation - #16
Merged
Merged
Conversation
Two bugs in the Three.js preview (three-preview.jsx): - Flicker after "Bump size to Nmm": the camera near/far were fixed at 0.1/5000, so the depth buffer lost precision as the plate grew and the thin coplanar layers strobed. Anchor near/far to the model radius so the near:far ratio (and depth precision) stays constant at every size/zoom. Also add polygonOffset to the region material so the edge outlines stop z-fighting the surface. - Limited X rotation: drag-rotate was clamped to about +/-88 degrees. Remove the clamp so the plate can tumble freely and show its back. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two bugs in the Three.js print preview (
three-preview.jsx).1. Flicker after "Bump size to Nmm"
The camera
near/farwere fixed at0.1/5000, so as the plate grew the depth buffer lost precision and the thin coplanar layers strobed (z-fighting). Nownear/farare anchored to the model radius, keeping the near:far ratio — and thus depth precision — constant at any size and zoom. Also addedpolygonOffsetto the region material so the edge outlines render cleanly on top instead of fighting the surface.2. X rotation was limited to ~±88°
Drag-rotate clamped
rotX. Removed the clamp so the plate tumbles freely and you can inspect the back.Verified live: clean surfaces at 300mm even at grazing angles, and full flip-over rotation.
🤖 Generated with Claude Code