Composable Function

SpatialGltfModel

This composable renders a glTF or .glb model that is loaded asynchronously from the provided source.

SpatialGltfModelSample

@Sampled
@Composable
@SubspaceComposable
public fun SpatialGltfModelSample(modifier: SubspaceModifier) {
    val duckModelUri =
        "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/main/Models/Duck/glTF-Binary/Duck.glb"
    val state =
        rememberSpatialGltfModelState(SpatialGltfModelSource.fromUri(Uri.parse(duckModelUri)))
    SpatialGltfModel(state = state, modifier = modifier)
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: