KhronosGroup / KhronosGroup/glTF-Sample-Viewer
Scene selector shows wrong positions for non-default scenes (multi-scene glb)
- Dominant language
- JavaScript
- Stars
- 1.5k
- Forks
- 264
- Avg merge
- 5h 49m
- Merged PRs (30d)
- 1
Description
I have a .glb with 3 scenes (exported from 3ds Max via glTF-3ds-Max-Plugin's multi-scene-by-layer export). The default scene renders fine, but switching to any other scene via the scene dropdown shows all objects collapsed near (0,0,0) instead of their correct positions.
I checked the file's JSON directly — each scene has its own root node with correct, non-degenerate transforms. I also loaded it manually with three.js's GLTFLoader, swapping between gltf.scenes[], and all three scenes render correctly there. So the data in the file looks fine; the bug seems to be in how the Sample Viewer recomputes transforms on scene switch.
Steps to reproduce:
In 3ds Max, create a couple of primitives (e.g. a box and a cylinder) placed away from the origin, and split them across different layers.
Export as multi-scene glb using glTF-3ds-Max-Plugin (each layer becomes its own scene).
Open the resulting glb in the Sample Viewer : the active/default layer at export time renders correctly.
Switch to any other scene via the scene dropdown : its geometry appears collapsed at the origin instead of at its authored position.
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue does not name files or tests. Start at the Sample Viewer scene dropdown and trace scene switching and transform recomputation, comparing it with three.js GLTFLoader behavior for gltf.scenes[]. Done means the non-default scenes retain their authored object positions instead of collapsing at the origin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, three.js
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100