{"_id":"5ba1a04d4f89f700039d85c9","project":"5a065a6134873d0010b396ab","version":{"_id":"5ba1a04d4f89f700039d85d0","project":"5a065a6134873d0010b396ab","__v":0,"forked_from":"5b8469fbe0a7ea00039d96b8","createdAt":"2018-04-18T18:19:34.288Z","releaseDate":"2018-04-18T18:19:34.288Z","categories":["5ba1a04d4f89f700039d8594","5ba1a04d4f89f700039d8595","5ba1a04d4f89f700039d8596","5b05923ea5a2f9000357b452","5b05f793c2c86c0003cbe414","5ba1a04d4f89f700039d8597","5ba1a04d4f89f700039d8598","5ba1a04d4f89f700039d8599"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.11.0","version":"1.11.0"},"category":{"_id":"5ba1a04d4f89f700039d8597","project":"5a065a6134873d0010b396ab","version":"5ba1a04d4f89f700039d85d0","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-05-24T14:09:29.251Z","from_sync":false,"order":2,"slug":"develop-ar","title":"Augmented Reality"},"user":"579a69d53de0a217007eda56","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-05-24T14:11:22.343Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Device Support\",\n  \"body\": \"Viro uses ARCore for tracking. The list of supported devices is provided [here](https://developers.google.com/ar/discover/supported-devices).\"\n}\n[/block]\nThe Viro platform supports Augmented Reality (AR) development through various AR-specific components and features. This guide offers an overview of AR and a high-level look at the tools Viro provides to build these experiences.\n[block:api-header]\n{\n  \"title\": \"Building AR Experiences\"\n}\n[/block]\nThe Viro platform provides a large suite of components that developers can leverage to build their AR experiences. However, unlike traditional 3D rendering and VR, AR experiences are meant to be responsive to the user's real world. In order to accomplish this, the Viro platform provides a number of AR specific classes and features detailed below:\n\n## AR Classes\n\nThe following is an overview of AR classes provided by Viro.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Class\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"[ViroViewARCore](https://developer.viromedia.com/virocore/reference/com/viro/core/ViroViewARCore.html)\",\n    \"0-1\": \"Top-level Android View for rendering AR content. The camera feed is automatically rendered as the view's background.\",\n    \"1-0\": \"[ARScene](https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.html)\",\n    \"1-1\": \"Maintains a scene graph that is rendered in AR atop the real-world. Enables the creation of anchors to latch virtual objects onto the real-world. Provides a callback interface you can use to be alerted when 'trackable' objects like horizontal or vertical planes are detected.\",\n    \"2-0\": \"[ARAnchor](https://developer.viromedia.com/virocore/reference/com/viro/core/ARAnchor.html)\",\n    \"2-1\": \"Anchors connect nodes (ARNodes) to the real-world. You can also hoist these up to the cloud to create multiplayer AR applications.\",\n    \"3-0\": \"[ARNode](https://developer.viromedia.com/virocore/reference/com/viro/core/ARNode.html)\",\n    \"3-1\": \"Scene-graph node that's anchored to the real-world by way of an ARAnchor. Adding content to ARNodes ensures the content will not drift.\",\n    \"4-0\": \"[ARPlaneAnchor](https://developer.viromedia.com/virocore/reference/com/viro/core/ARPlaneAnchor.html)\",\n    \"4-1\": \"Anchor that represents a horizontal or vertical plane that the AR system detected in the real world. This can be the surface for table-top game, or a wall on which to mount a virtual picture.\",\n    \"5-0\": \"[ARImageAnchor](https://developer.viromedia.com/virocore/reference/com/viro/core/ARImageAnchor.html)\",\n    \"5-1\": \"Anchor that represents a detected image. You can create entire virtual user interfaces that appear over real-world images. Or make things like movie posters come alive when they're detected.\",\n    \"6-0\": \"[ARImageTarget](https://developer.viromedia.com/virocore/reference/com/viro/core/ARImageTarget.html)\",\n    \"6-1\": \"Define what images you want Viro to detect by creating and adding ARImageTargets.\",\n    \"7-0\": \"[ARPointCloud](https://developer.viromedia.com/virocore/reference/com/viro/core/ARPointCloud.html)\",\n    \"7-1\": \"Render the AR point cloud or extract its raw data for debugging. The AR point cloud is the feed of edge and image detection data coming into the system.\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]\n## AR Enhanced APIs\n\nThe AR system also provides other information which we make available through the following APIs on our existing components.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Feature\",\n    \"h-1\": \"API Location\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"6 Degrees of Camera Movement\",\n    \"0-1\": \"Camera position and orientation can be accessed from ViroView.\",\n    \"0-2\": \"The camera automatically moves in step with the user's movements in the real world. This results in virtual objects appearing to stay in their positions.\",\n    \"1-0\": \"Video Pass Through (rendered as background)\",\n    \"1-1\": \"Automatic\",\n    \"1-2\": \"In AR, the back camera is enabled and serves as the \\\"background\\\" of the view onto which virtual objects are rendered.\",\n    \"2-0\": \"Ambient Light Estimation\",\n    \"2-1\": \"ARScene offers two methods [getEstimatedAmbientLightIntensity()][1] and [getEstimatedAmbientLightColor()][2]. You can also listen for ambient light updates in the [ARScene.Listener][3].\\n\\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.html#getEstimatedAmbientLightIntensity()\\n[2]: https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.html#getEstimatedAmbientLightColor()\\n[3]: https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.Listener.html\",\n    \"2-2\": \"Provides an estimate of light intensity and color as detected by the camera.\",\n    \"3-0\": \"```Fixed to World``` and ```Fixed to Plane``` Dragging\",\n    \"3-1\": \"Supported by all Nodes by setting the Node's [drag type][1].\\n\\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/Node.DragType.html\",\n    \"3-2\": \"Allows the user to drag objects such that they look fixed to points or planes in the real world.\",\n    \"4-0\": \"AR-based Hit Tests\",\n    \"4-2\": \"Allows to user to get points in the real world from the AR system. For example, if the user touches the screen, what real-world object (if any) did she touch?\",\n    \"4-1\": \"[ViroViewARCore][1] provides a variety of ```performARHitTest```\\nmethods.\\n\\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/ViroViewARCore.html\",\n    \"5-0\": \"Portals\",\n    \"5-2\": \"Allows the developer to add a virtual \\\"portal\\\" from the real-world into a virtual world, and back again.\",\n    \"5-1\": \"[Portal][1] and [PortalScene][2].\\n\\n[1]:https://developer.viromedia.com/virocore/reference/com/viro/core/Portal.html\\n\\n[2]:https://developer.viromedia.com/virocore/reference/com/viro/core/PortalScene.html\",\n    \"6-0\": \"Video and still capture\",\n    \"6-2\": \"Makes it easy to record and share AR experiences with others.\",\n    \"6-1\": \"The [ViroMediaRecorder][1] accessible from the ViroView.\\n\\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/ViroMediaRecorder.html\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\nWith the above features, developers can illuminate their AR experiences with more realistic lighting, make their virtual objects interact realistically with the environment, add other-worldly portals, and much more.","excerpt":"Powering AR with Viro","slug":"ar-overview","type":"basic","title":"Overview"}

Overview

Powering AR with Viro

[block:callout] { "type": "warning", "title": "Device Support", "body": "Viro uses ARCore for tracking. The list of supported devices is provided [here](https://developers.google.com/ar/discover/supported-devices)." } [/block] The Viro platform supports Augmented Reality (AR) development through various AR-specific components and features. This guide offers an overview of AR and a high-level look at the tools Viro provides to build these experiences. [block:api-header] { "title": "Building AR Experiences" } [/block] The Viro platform provides a large suite of components that developers can leverage to build their AR experiences. However, unlike traditional 3D rendering and VR, AR experiences are meant to be responsive to the user's real world. In order to accomplish this, the Viro platform provides a number of AR specific classes and features detailed below: ## AR Classes The following is an overview of AR classes provided by Viro. [block:parameters] { "data": { "h-0": "Class", "h-1": "Description", "0-0": "[ViroViewARCore](https://developer.viromedia.com/virocore/reference/com/viro/core/ViroViewARCore.html)", "0-1": "Top-level Android View for rendering AR content. The camera feed is automatically rendered as the view's background.", "1-0": "[ARScene](https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.html)", "1-1": "Maintains a scene graph that is rendered in AR atop the real-world. Enables the creation of anchors to latch virtual objects onto the real-world. Provides a callback interface you can use to be alerted when 'trackable' objects like horizontal or vertical planes are detected.", "2-0": "[ARAnchor](https://developer.viromedia.com/virocore/reference/com/viro/core/ARAnchor.html)", "2-1": "Anchors connect nodes (ARNodes) to the real-world. You can also hoist these up to the cloud to create multiplayer AR applications.", "3-0": "[ARNode](https://developer.viromedia.com/virocore/reference/com/viro/core/ARNode.html)", "3-1": "Scene-graph node that's anchored to the real-world by way of an ARAnchor. Adding content to ARNodes ensures the content will not drift.", "4-0": "[ARPlaneAnchor](https://developer.viromedia.com/virocore/reference/com/viro/core/ARPlaneAnchor.html)", "4-1": "Anchor that represents a horizontal or vertical plane that the AR system detected in the real world. This can be the surface for table-top game, or a wall on which to mount a virtual picture.", "5-0": "[ARImageAnchor](https://developer.viromedia.com/virocore/reference/com/viro/core/ARImageAnchor.html)", "5-1": "Anchor that represents a detected image. You can create entire virtual user interfaces that appear over real-world images. Or make things like movie posters come alive when they're detected.", "6-0": "[ARImageTarget](https://developer.viromedia.com/virocore/reference/com/viro/core/ARImageTarget.html)", "6-1": "Define what images you want Viro to detect by creating and adding ARImageTargets.", "7-0": "[ARPointCloud](https://developer.viromedia.com/virocore/reference/com/viro/core/ARPointCloud.html)", "7-1": "Render the AR point cloud or extract its raw data for debugging. The AR point cloud is the feed of edge and image detection data coming into the system." }, "cols": 2, "rows": 8 } [/block] ## AR Enhanced APIs The AR system also provides other information which we make available through the following APIs on our existing components. [block:parameters] { "data": { "h-0": "Feature", "h-1": "API Location", "h-2": "Description", "0-0": "6 Degrees of Camera Movement", "0-1": "Camera position and orientation can be accessed from ViroView.", "0-2": "The camera automatically moves in step with the user's movements in the real world. This results in virtual objects appearing to stay in their positions.", "1-0": "Video Pass Through (rendered as background)", "1-1": "Automatic", "1-2": "In AR, the back camera is enabled and serves as the \"background\" of the view onto which virtual objects are rendered.", "2-0": "Ambient Light Estimation", "2-1": "ARScene offers two methods [getEstimatedAmbientLightIntensity()][1] and [getEstimatedAmbientLightColor()][2]. You can also listen for ambient light updates in the [ARScene.Listener][3].\n\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.html#getEstimatedAmbientLightIntensity()\n[2]: https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.html#getEstimatedAmbientLightColor()\n[3]: https://developer.viromedia.com/virocore/reference/com/viro/core/ARScene.Listener.html", "2-2": "Provides an estimate of light intensity and color as detected by the camera.", "3-0": "```Fixed to World``` and ```Fixed to Plane``` Dragging", "3-1": "Supported by all Nodes by setting the Node's [drag type][1].\n\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/Node.DragType.html", "3-2": "Allows the user to drag objects such that they look fixed to points or planes in the real world.", "4-0": "AR-based Hit Tests", "4-2": "Allows to user to get points in the real world from the AR system. For example, if the user touches the screen, what real-world object (if any) did she touch?", "4-1": "[ViroViewARCore][1] provides a variety of ```performARHitTest```\nmethods.\n\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/ViroViewARCore.html", "5-0": "Portals", "5-2": "Allows the developer to add a virtual \"portal\" from the real-world into a virtual world, and back again.", "5-1": "[Portal][1] and [PortalScene][2].\n\n[1]:https://developer.viromedia.com/virocore/reference/com/viro/core/Portal.html\n\n[2]:https://developer.viromedia.com/virocore/reference/com/viro/core/PortalScene.html", "6-0": "Video and still capture", "6-2": "Makes it easy to record and share AR experiences with others.", "6-1": "The [ViroMediaRecorder][1] accessible from the ViroView.\n\n[1]: https://developer.viromedia.com/virocore/reference/com/viro/core/ViroMediaRecorder.html" }, "cols": 3, "rows": 7 } [/block] With the above features, developers can illuminate their AR experiences with more realistic lighting, make their virtual objects interact realistically with the environment, add other-worldly portals, and much more.