michaelm682
michaelm682

Reputation: 11

Google Model Viewer AR- How to have "View in AR" button with out having poster or object preview

Is it possible to view my GLTF and USDZ file in AR from clicking a button. I do not want to have a background poster or object preview just a button.

Upvotes: 0

Views: 3264

Answers (2)

Aseliot
Aseliot

Reputation: 97

Maybe you already solved this long ago.

But here: https://modelviewer.dev/examples/model-formats.html

You can see "With only a USDZ model" it should be possible. You could make the poster an empty/transparent image.

Then edit the button ui and make the model-viewer as big as your button. https://modelviewer.dev/examples/customizing-ui.html

From what I can see that is the best thing you can do right now.

EDIT:

Whoops, actually you can just call an intent to Scene Viewer in a link then style it as a button. Or a button with some js.

https://developers.google.com/ar/develop/java/scene-viewer#3d-or-ar

Upvotes: 1

mick1996
mick1996

Reputation: 606

From @Florian 's answer above I was able to add a link to an image like this:

   <a href="assets/models/Nachos.usdz" class="external-link" >
     <img src="assets/arkits.png" />
   </a>

Upvotes: 0

Related Questions