Check Mobile App
Read now
Start a Project

AR core with glb/gltf model using Sceneform

Save

The 3D model can in the form of GLB or GLTF format and these 3D models can be loaded at runtime without conversion. Which is an improvement in the flexibility of the models rendered in the application.

In this blog, we will be using the GLB format because the GLTF model is dependent on there .bin file which has to be saved with its corresponding file but a GLB file contains a 3D model saved in the GL Transmission Format (glTF). It stores information about a 3D model, such as node hierarchy, cameras, and materials, animations, and meshes in binary format. GLB files are the binary version of .gltf files.

 

Some important links for the AR model

1:Conversion from .gltf to .glb online :

Copy all the file from the model(.gltf and .bin file) and drag on this link: Click here

2: Conversion from .obj to .glb offline using node.js:   Click here

3: To get the sample models: Click here

 

Let’s get it into code

 

1. In your project build.gradle dependencies:

2. In your app build.gradle dependencies:

 

3. In the Android Manifest.xml file:

3. Adding ar code on the MainActivity.kt file:

 

4. Let’s add the sceneform ArFragment on the layout code of activity_ar.xml code:

 

Now you just have to pass the .glb/.gltf model URL on the “arModel” string. Now just run your app.

 

 

 

. . . . . . . . . .

That’s it from my side for today, thanks for reading it until now.

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


2 comments

  • Preeti
    Project is not completly uploaded. Some classes and other things also missed.
    • Deepak Rawat (Moderator)
      Can you please share the classes that are missing and errors you are facing.
  • css.php

    When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

    Michael Urresta

    Michael Urresta

    Talk to Sales

    Global

    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home