Conversation
Files exported from Z-up tools (Blender) or Y-down conventions (OpenCV, COLMAP) appeared tilted because three.js is Y-up. Add the `3dpreview.upAxis` setting and an "Up axis" GUI dropdown offering +X, -X, +Y, -Y, +Z and -Z. Instead of rewriting vertex data, all loaded objects now live in a THREE.Group that is rotated about the model's bounding-box centre, so the model stays in place, switching is instant and repeatable, and no mirroring can occur. The axes helper is a child of that group and shows the file's own axes; the grid helper stays in world space so it always reads as the floor. The camera is left untouched when the axis changes. Bounding-box helpers in utils.js now accept either a geometry or a THREE.Box3 so that world-space boxes can be used for camera placement and grid positioning. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kvyv4yLA7eMxRmEGDhHt4m
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.
Summary
Addresses #14. Files exported from Z-up tools (Blender) or Y-down conventions (OpenCV, COLMAP) appeared tilted because three.js is Y-up. This adds the
3dpreview.upAxissetting and an "Up axis" GUI dropdown with+X,-X,+Y,-Y,+Z,-Z.Design
THREE.Group. Changing the up axis only sets the group's rotation, so switching is instant, repeatable and cannot introduce mirroring (every entry is a pure rotation). This replaces the vertex-rewriting approach of feat: Add the option to change coordinate conventions #16.utils.getBBoxCenter/getBBoxMaxExtent/autoCameraPosaccept either a geometry or aTHREE.Box3, so world-space boxes can be used for camera placement and grid positioning.Only the up axis is configurable; the rotation about it is left to the user's mouse, which keeps the setting to a single dropdown.
Verification
npm run compileandnpm run lintpass.bunny.objloaded with each of the six axes renders without console errors, and the axes helper visibly follows the rotation.+Yand switching the dropdown to+Zproduces a screenshot identical (0 differing bytes) to loading with+Zdirectly, confirming the camera is retained and the model rotates about its centre.Closes #14
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kvyv4yLA7eMxRmEGDhHt4m
Generated by Claude Code