loadModelInstance

suspend fun loadModelInstance(fileLocation: String, resourceResolver: (resourceFileName: String) -> String = { getFolderPath(fileLocation, it) }): ModelInstance?

Loads a Model from the contents of a GLB or GLTF file and get its default instance.

Parameters

fileLocation

the .glb or .gltf file location:

  • A relative asset file location models/mymodel.glb

  • An android resource from the res folder context.getResourceUri(R.raw.mymodel)

  • A File path Uri.fromFile(myModelFile).path

  • An http or https url https://mydomain.com/mymodel.glb

See also