dongwon lee
dongwon lee

Reputation: 79

Why make an Object the Anchor's child?

I tested the HelloAR Example of ARCore. When you create an Object by touching the screen of the device, you perform CreateAnchor and then move the Object to the Anchor's child. Do you have any reason to be a child?

Upvotes: 2

Views: 496

Answers (2)

Andy Jazz
Andy Jazz

Reputation: 58113

Because it is a regular 3D scene hierarchy. It's build the same way as in 3D animation software, like Autodesk Maya. Nodes' hierarchy simplifies transformations (translate, rotate and scale) during animation and simplifies positioning in World Space. All 3D objects in your AR app are located in World Coordinates.

For example: Your 3D scene has a Root Node (Parent Node). Any Geometry, Cameras, Lights or ARAnchors must have Child Nodes in order to be connected to Root Node. And if you wanna place a Renderable in your scene, its Child Node has to be connected to ARAnchor's Parent Node.

enter image description here

One more example: imagine a family's members – grandfather, father and son. Father is simultaneously a child of grandfather (his node is considered as a Child Node), and he is a parent of his son (at the same time his node is considered as a Parent Node).

Hope this helps.

Upvotes: 1

Ali Kanat
Ali Kanat

Reputation: 1889

Because by making a 3D object a child of an anchor, you attach that object to a Trackable. By nature ARCore can not track your 3D models but when you anchor them you attach that 3D model to something that can be tracked by ARCore. So your 3D model can be tracked as well.

Another point on this is the usage of local positions. Because every time you run an application that uses ARCore, you would get different coordinate systems as you might have noticed. However, by using anchors and making objects child of those anchors you can leverage local positions. For example, in Augmented Images example, no matter what your coordinate system frame of the image will always appear on the corners of the 2D image. This is achieved via anchoring and local positions properties.

Upvotes: 3

Related Questions