google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.95k stars 1.22k forks source link

Child node not showing, when parent's worldRotation is changed #817

Closed pjonceski closed 3 years ago

pjonceski commented 5 years ago

SPECIFIC ISSUE ENCOUNTERED Hi, I am adding an Anchor that contains a parent Node .The parent node contains one children Node .

This is the code that i use to add the parent: Node().apply { modelObject?.let { val anchorNode = AnchorNode(anchor).also { anchor -> anchor.setParent(fragment.arSceneView.scene) } this.setParent(anchorNode) this.renderable = it } The code to add the node: Node().apply { renderable = viewRenderable setParent(parent) localPosition = Vector3(0f, 0.005f, 0.005f) localScale = Vector3(0.5f, 0.5f, 0.5f) } Then on every frame update i change the worldRotation on the parent node. The parent node is rendering ok but I get flicker effect on the child node. As i move the camera sometimes it will be shown but then it goes away.

To update the parent node I use this code which is from the ArCore tutorials: val cameraPosition = fragment.arSceneView.scene.camera.worldPosition val direction = Vector3.subtract(cameraPosition, parentNode.worldPosition) val lookRotation = Quaternion.lookRotation(direction, Vector3.up()) parentNode.worldRotation = lookRotation

VERSIONS USED

devbridie commented 3 years ago

As a part of ongoing efforts to maintain ARCore repositories, I’m closing this issue as stale. If this is still an issue, you can use the newly open-sourced Sceneform SDK sources to try to diagnose the problem, or find a community-reared fork in which the issue has been addressed.