google / model-viewer

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

AR mode camera not as expected. the camera jump to origin instead or tracking the environment and put the model in place #1665

Closed TomDDH closed 3 years ago

TomDDH commented 3 years ago

Hey all I have some problem, work with the GLB files,(this what i think)

I export the GLB file from substance painter, but when put on web, and active the AR, the model jump to my head, it seem my position is the origin and the model is above me. you can have experience on this https://virbikes.s3.us-east-2.amazonaws.com/motocycle_demo_test_1.html

but with the same code, just change the GLB source to Model-Viewer library model it work perfect. you can see from here. https://virbikes.s3.us-east-2.amazonaws.com/motocycle_demo_test_2.html

if someone know why thanks

elalish commented 3 years ago

I can repro. I bet the problem is model scale; it looks like it's probably vastly too large. glTF specifies that all files are in units of meters, so if this was modeled in mm, it will end up gigantic. It's hard to tell the scale because we can't occlude it, but it's probably the size of a skyscraper.

TomDDH commented 3 years ago

Thanks Elalish I finally figured out. the Andriod use GLB which working in units of meters, and IOS working in units of Centimeter. that is cause the confusion.

TomDDH commented 3 years ago

Thanks very much