Skip to content

Fix 3D preview: stop bump-size flicker and free up X rotation - #16

Merged
kurenn merged 1 commit into
mainfrom
fix-3d-preview
Jun 9, 2026
Merged

kurenn merged 1 commit into
mainfrom
fix-3d-preview

Conversation

@kurenn

@kurenn kurenn commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Fixes two bugs in the Three.js print preview (three-preview.jsx).

1. Flicker after "Bump size to Nmm"

The camera near/far were fixed at 0.1/5000, so as the plate grew the depth buffer lost precision and the thin coplanar layers strobed (z-fighting). Now near/far are anchored to the model radius, keeping the near:far ratio — and thus depth precision — constant at any size and zoom. Also added polygonOffset to 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

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>
@kurenn
kurenn merged commit 6a728e2 into main Jun 9, 2026
2 checks passed
@kurenn
kurenn deleted the fix-3d-preview branch June 9, 2026 17:25
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.

1 participant