loadModelAsync

fun loadModelAsync(fileLocation: String, resourceResolver: (resourceFileName: String) -> String = { getFolderPath(fileLocation, it) }, onResult: (Model?) -> Unit): Job

Loads a Model from the contents of a GLB or GLTF file within a self owned coroutine scope.

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