You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add up-axis selection for the file's coordinate system (#14)
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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,10 @@ All notable changes to the "vscode-3dpreview" extension will be documented in th
4
4
5
5
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6
6
7
+
## Unreleased
8
+
9
+
- Add the `3dpreview.upAxis` setting and GUI dropdown to choose which axis of the file points up (+X, -X, +Y, -Y, +Z, -Z). The model is rotated in place, the axes helper follows the file's coordinate system and the grid stays on the world floor ([#14](https://github.com/tatsy/vscode-3d-preview/issues/14)).
10
+
7
11
## v0.2.5
8
12
9
13
- Restore free rotation with `TrackballControls` and add the `3dpreview.cameraControls` setting to switch between trackball and orbit controls ([#12](https://github.com/tatsy/vscode-3d-preview/issues/12)).
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ All settings live under the `3dpreview` namespace and act as the initial values
43
43
| Setting | Default | Description |
44
44
|:--|:--|:--|
45
45
|`hideControlsOnStart`|`false`| Fold the control panel when the viewer opens. |
46
+
|`upAxis`|`"+Y"`| Axis of the file's coordinate system that points up in the viewer. Choose `"+Z"` for Z-up data such as Blender exports and `"-Y"` for OpenCV/COLMAP conventions. The axes helper shows the file's own axes; the grid stays on the world floor. |
46
47
|`cameraControls`|`"trackball"`|`"trackball"` allows free rotation in any direction. `"orbit"` keeps the camera upright and cannot pass over the poles. |
47
48
|`showMesh`|`true`| Show mesh triangles. |
48
49
|`flatShading`|`false`| Use flat shading instead of smooth shading for meshes. STL files are always rendered flat because the format stores no shared vertices. |
Copy file name to clipboardExpand all lines: package.json
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,19 @@
146
146
"minimum": 0,
147
147
"description": "Intensity of the directional light that follows the camera. Set 0 to disable it."
148
148
},
149
+
"3dpreview.upAxis": {
150
+
"type": "string",
151
+
"default": "+Y",
152
+
"enum": [
153
+
"+X",
154
+
"-X",
155
+
"+Y",
156
+
"-Y",
157
+
"+Z",
158
+
"-Z"
159
+
],
160
+
"description": "Axis of the file's coordinate system that points up in the viewer. Use \"+Z\" for Z-up data such as Blender exports and \"-Y\" for OpenCV/COLMAP conventions."
0 commit comments