model-viewer
model-viewer copied to clipboard
glTF Viewer Shows Different Size Than In Editor
Original Post https://forum.playcanvas.com/t/solved-imported-glb-keeps-disappearing/22796/1
Imported binary GLB with morph targets (and embedded textures) displays different sizes in the PlayCanvas glTF 2.0 Viewer than in the PlayCanvas Web Editor.
Model Source:
https://github.com/RandomPandaStudios/hosting/blob/main/AC_PlayerModel_Red.glb
glTF Model Preview:
https://playcanvas.com/viewer/?load=https://raw.githubusercontent.com/RandomPandaStudios/hosting/main/AC_PlayerModel_Red.glb
@rpaladin I was just reviewing this old issue. The model viewer has gone through many updates since this was logged. The GLB looks like it's correctly rendered in the viewer now. Can you confirm? If all is well, we can close the issue.
Hi @willeastcott. I just checked. I'm not sure if the PlayCanvas Viewer issue still exists.. It appears that if the window is resized + maximized on start (instead of starting in maximized window mode initially), the window aspect ratio / resolution isn't updated to reflect the new window mode + size. I'm not sure if this was perhaps what I was experiencing originally.
Chrome
Start Window Maximized:
Start Window Un-maximized + small size: -> Set maximized
Edge
Start Window Maximized:
Start Window Un-maximized + small size: -> Set maximized
Firefox
Start Window Maximized:
Start Window Un-maximized + small size: -> Set maximized
I don't seem to be able to reproduce this. I just tried in Chrome and Edge. Here's what I saw in Edge, for example:
https://github.com/playcanvas/model-viewer/assets/697563/fcde032c-9fba-446d-a9b7-df121bfd04cb
I think you're not able to reproduce it because your browser window is already in maximized mode. I can consistently reproduce the issue when I:
- Start the window unmaximized.
- On (or after) viewer load, maximize the window.
- The ratio/size of the window should not update for the newly maximized window.
Ok I can kind of replicate this. If you start with a small window with narrow/tall aspect ratio then maximise to a wide aspect ratio, the content zooms out. I think this is because the FOV adapts or does not change correctly with the window size