google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.69k stars 798 forks source link

Generated usdz has a random y rotation when the auto-rotate attribute is used #4732

Closed vincentfretin closed 2 months ago

vincentfretin commented 3 months ago

Description

When not using ios-src, the generated usdz is correctly facing us when you don't have the auto-rotate attribute on the model-viewer tag. When you have the auto-rotate attribute set, the generated usdz y rotation is different each time you click on the AR button. I have currently no idea how this is correlated and where in the code the issue may be. I found the issue while testing the placement "wall" for QuickLook, see my original comment https://github.com/google/model-viewer/pull/4030#issuecomment-2030234235

Live Demo

https://vfretin-wrong-usdz-y-rotation.glitch.me/ I removed the ios-src attribute and kept the auto-rotate attribute.

https://vfretin-ok-usdz-y-rotation.glitch.me/ I removed the ios-src and the auto-rotate attributes. This one is working correctly.

Version

Browser Affected

OS

AR

elalish commented 2 months ago

Thank you for the very clear repro!

vincentfretin commented 2 months ago

I'm glad you found the issue and did the fix!