-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Labels
Description
Hey there! Thank you for this useful library which saves a lot of time when working with ARCore :)
I'm trying to create an android app that shows AR markers by specific location (LatLng). I'd like to create something like in this video (from README AR Geospatial API), but with simple ViewNode instead of ArModelNode.
I also can't place AR model at a specific location with a sample code from README. The model spawns just in front of the current camera position.
Here is my code:
val earth = binding.sceneView.arSession?.earth ?: return@launchWhenResumed
if (earth.trackingState == TrackingState.TRACKING) {
val cameraGeospatialPose = earth.cameraGeospatialPose
val earthAnchor = earth.createAnchor(49.844141, 24.024532, cameraGeospatialPose.altitude, 0f, 0f, 0f, 1f)
val arModelNode = ArModelNode(
context = this@MainActivity,
lifecycle = lifecycle,
modelFileLocation = "https://sceneview.github.io/assets/models/Gumball.glb"
)
arModelNode.anchor = earthAnchor
binding.sceneView.addChild(arModelNode)
}I would be grateful for your help!