Interactive AR with Scene Viewer and Android Intent
There are many ways to show interactive 3D models in AR. One of those ways is to use Scene Viewer with intents directly from your Android native app. In this short post, I will guide you through this app-based experience and different preview options.
Common use cases and challenges
There are several use cases when you want to consider using Scene Viewer instead of implementing own native AR functionality:
Display static 3D model in space, for example, furniture like sofa and chairs
Display 3D models with simple animation, for example, zoo app to visualise different animals with simple animation
Scene Viewer has limited functionality and you should keep in mind following disadvantages:
Supports only one animation in glTF file
Cannot set model transformation or scale in Intent parameters
Does not support all glTF format features
NOTE: Check your 3D models in Scene Viewer Preview tool to make sure it will work with Scene Viewer properly. Possible error messages:
Android Intent to Scene Viewer
To call Scene Viewer from a native android app, we will use explicit intent to the Google Search package. Use the following code to call the intent from Kotlin:
Create Dynamic Intent to Scene Viewer
I have created a sample app to test different Scene Viewer settings and be able to dynamically construct the intent data. Below you can find two code snippets on how you can build explicit intent to Google Search package.
Read UI values and generate intent Uri for selected options as following:
Check out the final version of the app and try out different settings: