google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

3D models fly away from the screen #132

Closed geraldika closed 6 years ago

geraldika commented 6 years ago

I take coordinates from server and try to show 3d models in app. I create nodes for my models by next methods:

Pose.makeTranslation(myX, myY, myZ). Anchor anchor = arSceneView.getSession().createAnchor(pose); AnchorNode anchorNode = new AnchorNode(anchor); anchorNode.setParent(arSceneView.getScene()); TransformableNode node = new TransformableNode (arFragment.getTransformationSystem()); arObject.setAnchor(anchor); node.setParent(anchorNode); node.setRenderable(modelsRenderer.getModelByType(myObject.getType())); node.select();

Sometimes my 3d models just fly away from the screen. I can't solve this problem.

phoenixxt commented 6 years ago

I've had the same issues on Nexus 6P, but at the same time everything has worked fine on Samsung s8+.

geraldika commented 6 years ago

@phoenixxt Samsung works better than Nexus. But this problem appears on Samsung too, if I try to show objects not by tap on the screen.

malik-at-work commented 6 years ago

This sounds like a problem tracking in ArCore. If tracking is lost the anchors will move.

This may also be related to ArCore issue https://github.com/google-ar/arcore-android-sdk/issues/225

One thing to consider to get the best results is controlling how well ArCore has processed the current area in view. We typically do not place any objects until at least one plane has been found. Although there could be more strict requirements than that for object placement.

15kingben commented 6 years ago

If we are not using planes in our application do you have a suggestion for what metrics to track? One thought was counting the number of points in the point cloud but that does not seem robust.

chnouman commented 4 years ago

@malik-at-work This is impacting our users very poorly please consider resolving it at priority basis. The model should not fly away from the scene.

chnouman commented 4 years ago
val anchor = session!!.createAnchor(
                        frame!!.camera.displayOrientedPose.compose(Pose.makeTranslation(0f, 0f, -0.3f)).extractTranslation()
                )

Flying almost each time. @malik-at-work