Skip to content

Instantly share code, notes, and snippets.

@prideout
Created April 3, 2020 02:11
Show Gist options
  • Save prideout/c6356e0cbe2911f56e32bb032b9f498e to your computer and use it in GitHub Desktop.
Save prideout/c6356e0cbe2911f56e32bb032b9f498e to your computer and use it in GitHub Desktop.
getting-started-json
override fun onCreate(savedInstanceState: Bundle?) {
// ...
//loadGlb("DamagedHelmet")
loadGltf("BusterDrone")
loadEnvironment("venetian_crossroads_2k")
}
private fun loadGltf(name: String) {
val buffer = readAsset("models/${name}.gltf")
modelViewer.loadModelGltf(buffer) { uri -> readAsset("models/$uri") }
modelViewer.transformToUnitCube()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment