Reputation: 111
I can't find anything on the forums and I would like to manage to create a target on arcore integrated in the plane, like Measure. (Avoids lag with an image centered on the layout)
Do you have a starting point?
I think about that! but don't stay in the center
com.google.ar.sceneform.Camera camera = arFragment.getArSceneView().getScene().getCamera();
MaterialFactory.makeTransparentWithColor(MainActivity.this, new com.google.ar.sceneform.rendering.Color(Color.parseColor("#ff333d")))
.thenAccept(material -> {
nodeRenderable = ShapeFactory.makeSphere(0.008f, new Vector3(camera.getWorldPosition().x, camera.getWorldPosition().y, camera.getWorldPosition().z), material);
Upvotes: 1
Views: 566
Reputation: 7526
What you should do is to create a Node and add it as a child of the scene.
Then on each Node.onUpdate(FrameTime) do these steps
You can take a look at this Reticle class which is doing exactly that: https://github.com/SimonMarquis/AR-Toolbox/blob/fb31a9cfdf061104a4401cecc9bc73ffa7ad33e6/app/src/main/java/fr/smarquis/ar_toolbox/Settings.kt#L124-L185
Upvotes: 1