app/build.gradle
dependencies {
// Sceneview
implementation("io.github.sceneview:sceneview:2.1.1")
}
https://sceneview.github.io/api/sceneview-android/sceneview/
app/build.gradle
dependencies {
// ARSceneview
implementation 'io.github.sceneview:arsceneview:2.1.1'
}
val engine = rememberEngine()
val modelLoader = rememberModelLoader(engine)
val environmentLoader = rememberEnvironmentLoader(engine)
Scene(
modifier = Modifier.fillMaxSize(),
engine = engine,
modelLoader = modelLoader,
childNodes = rememberNodes {
add(ModelNode(modelLoader.createModelInstance("model.glb")).apply {
// Move the node 4 units in Camera front direction
position = Position(z = -4.0f)
})
},
environment = environmentLoader.createHDREnvironment("environment.hdr")!!
)
val engine = rememberEngine()
val modelLoader = rememberModelLoader(engine)
val model = modelLoader.createModel("model.glb")
var frame by remember { mutableStateOf<Frame?>(null) }
val childNodes = rememberNodes()
ARScene(
modifier = Modifier.fillMaxSize(),
engine = engine,
modelLoader = modelLoader,
onSessionUpdated = { session, updatedFrame ->
frame = updatedFrame
},
onGestureListener = rememberOnGestureListener(
onSingleTapConfirmed = { motionEvent, node ->
val hitResults = frame?.hitTest(motionEvent.x, motionEvent.y)
val anchor = hitResults?.firstOrNull {
it.isValid(depthPoint = false, point = false)
}?.createAnchorOrNull()
if (anchor != null) {
val anchorNode = AnchorNode(engine = engine, anchor = anchor)
anchorNode.addChildNode(
ModelNode(modelInstance = modelLoader.createInstance(model)!!)
)
childNodes += anchorNode
}
}
)
)
https://github.com/SceneView/sceneview-android/tree/main/samples
https://github.com/google/filament
- Buy devices to test the SDK on
- Equipment for decent video recording Tutorials and Presentations
- Sceneview Hosting Fees
- Send $9.99 on Open Collective (CB, Paypal, Google Pay,..)
- Buy a SceneView T-Shirt
- Create a Pull Request