model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

glTF Viewer Shows Different Size Than In Editor

Open rpaladin opened this issue 2 years ago • 5 comments

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 avatar Nov 10 '21 19:11 rpaladin

@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.

willeastcott avatar Sep 26 '23 13:09 willeastcott

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:

image

Start Window Un-maximized + small size: -> Set maximized

image

Edge

Start Window Maximized:

image

Start Window Un-maximized + small size: -> Set maximized

image

Firefox

Start Window Maximized:

image

Start Window Un-maximized + small size: -> Set maximized

image

rpaladin avatar Sep 26 '23 17:09 rpaladin

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

willeastcott avatar Sep 26 '23 18:09 willeastcott

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:

  1. Start the window unmaximized.
  2. On (or after) viewer load, maximize the window.
  3. The ratio/size of the window should not update for the newly maximized window.

rpaladin avatar Sep 27 '23 16:09 rpaladin

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

marklundin avatar Sep 28 '23 08:09 marklundin