# AR Foundation Samples
Example projects that use [*AR Foundation 4.2*](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) and demonstrate its functionality with sample assets and components.
This set of samples relies on five Unity packages:
* ARSubsystems ([documentation](https://docs.unity3d.com/Packages/[email protected]/manual/index.html))
* ARCore XR Plug-in ([documentation](https://docs.unity3d.com/Packages/[email protected]/manual/index.html))
* ARKit XR Plug-in ([documentation](https://docs.unity3d.com/Packages/[email protected]/manual/index.html))
* ARKit Face Tracking ([documentation](https://docs.unity3d.com/Packages/[email protected]/manual/index.html))
* ARFoundation ([documentation](https://docs.unity3d.com/Packages/[email protected]/manual/index.html))
## What version should I use?
| Unity Version | ARFoundation Version |
| ------------- | -------------------- |
| 2018.4 | [1.5 (preview)](https://github.com/Unity-Technologies/arfoundation-samples/tree/1.5-preview) |
| 2019.4 | [2.1 (verified)](https://github.com/Unity-Technologies/arfoundation-samples/tree/2.1) |
| 2020.1 | [3.1 (verified)](https://github.com/Unity-Technologies/arfoundation-samples/tree/3.1) |
| 2020.3 | [4.1 (verified)](https://github.com/Unity-Technologies/arfoundation-samples/tree/4.1) |
| 2021.1 | [4.1 (verified)](https://github.com/Unity-Technologies/arfoundation-samples/tree/4.1) |
| 2021.2 | 4.2 (prerelease) |
## ARSubsystems
ARFoundation is built on "[subsystems](https://docs.unity3d.com/2020.3/Documentation/ScriptReference/Subsystem.html)" and depends on a separate package called [ARSubsystems](https://docs.unity3d.com/Packages/[email protected]/manual/index.html). ARSubsystems defines an interface, and the platform-specific implementations are in the [ARCore](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) and [ARKit](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) packages. ARFoundation turns the AR data provided by ARSubsystems into Unity `GameObject`s and `MonoBehavour`s.
The `main` branch is compatible with Unity 2020.3 and later. For earlier versions, see the table above.
## Why is ARKit Face Tracking a separate package?
For privacy reasons, use of ARKit's face tracking feature requires additional validation in order to publish your app on the App Store. If your application binary contains certain face tracking related symbols, your app may fail validation. For this reason, we provide this feature as a separate package which must be explicitly included.
## Instructions for installing AR Foundation
1. Download the latest version of Unity 2020.3 or later.
2. Open Unity, and load the project at the root of the *arfoundation-samples* repository.
3. Open your choice of sample scene.
4. See the [AR Foundation Documentation](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) for usage instructions and more information.
# Samples
## SimpleAR
This is a good starting sample that enables point cloud visualization and plane detection. There are buttons on screen that let you pause, resume, reset, and reload the ARSession.
When a plane is detected, you can tap on the detected plane to place a cube on it. This uses the `ARRaycastManager` to perform a raycast against the plane.
| Action | Meaning |
| ------ | ------- |
| Pause | Pauses the ARSession, meaning device tracking and trackable detection (e.g., plane detection) is temporarily paused. While paused, the ARSession does not consume CPU resources. |
| Resume | Resumes a paused ARSession. The device will attempt to relocalize and previously detected objects may shift around as tracking is reestablished. |
| Reset | Clears all detected trackables and effectively begins a new ARSession. |
| Reload | Completely destroys the ARSession GameObject and re-instantiates it. This simulates the behavior you might experience during scene switching. |
## Check Support
Demonstrates checking for AR support and logs the results to the screen. The relevant script is [`SupportChecker.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/master/Assets/Scripts/SupportChecker.cs).
## LightEstimation
### BasicLightEstimation
Demonstrates basic light estimation information from the camera frame. You should see values for "Ambient Intensity" and "Ambient Color" on screen. The relevant script is [`BasicLightEstimation.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/master/Assets/Scripts/BasicLightEstimation.cs) script.
### HDRLightEstimation
This sample attempts to read HDR lighting information. You should see values for "Ambient Intensity", "Ambient Color", "Main Light Direction", "Main Light Intensity Lumens", "Main Light Color", and "Spherical Harmonics". Most devices only support a subset of these 6, so some will be listed as "Unavailable." The relevant script is [`HDRLightEstimation.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/master/Assets/Scripts/HDRLightEstimation.cs) script.
On iOS, this is only available when face tracking is enabled and requires a device that supports face tracking (such as an iPhone X, XS or 11). When available, a virtual arrow appears in front of the camera which indicates the estimated main light direction. The virtual light direction is also updated, so that virtual content appears to be lit from the direction of the real light source.
When using `HDRLightEstimation`, the sample will automatically pick the supported camera facing direction for you, for example `World` on Android and `User` on iOS, so it does not matter which you facing direction select in the `ARCameraManager.cs` component.
## Anchors
This sample shows how to create anchors as the result of a raycast hit. The "Clear Anchors" button removes all created anchors. See the [`AnchorCreator.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/master/Assets/Scripts/AnchorCreator.cs) script.
This script can create two kinds of anchors:
1. If a feature point is hit, it creates a normal anchor at the hit pose using the [AddAnchor](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.ARFoundation.ARAnchorManager.html#UnityEngine_XR_ARFoundation_ARAnchorManager_AddAnchor_UnityEngine_Pose_) method.
1. If a plane is hit, it creates an anchor "attached" to the plane using the [AttachAnchor](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.ARFoundation.ARAnchorManager.html#UnityEngine_XR_ARFoundation_ARAnchorManager_AttachAnchor_UnityEngine_XR_ARFoundation_ARPlane_UnityEngine_Pose_) method.
## Scale
This sample shows how to adjust the apparent scale of content in an AR scene. It does this by moving, rotating, and scaling the `ARSessionOrigin` instead of the content. Complex scenes often can't be moved after creation (e.g., terrain), and scale can negatively affect other systems such as physics, particle effects, and AI navigation. The `ARSessionOrigin`'s scale feature is useful if you want to make your content "appear" at a position on a detected plane and to scale, for example, a building sized object to a table-top miniature.
To use this sample, first move the device around until a plane is detected, then tap on the plane. Content will appear at the touch point. After the content is placed, you can adjust its rotation and scale using the on-screen sliders. Note that the content itself is never moved, rotated, or scaled.
The relevant script is [`MakeAppearOnPlane.cs`](https://github.com/Unity-Technologies/arfoundation-samples/blob/master/Assets/Scripts/MakeAppearOnPlane.cs).
## CpuImages
This samples shows how to acquire and manipulate textures obta
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
AR Foundation示例 使用并通过示例资产和组件演示其功能的示例项目。 这组样本依赖于五个Unity软件包: ARSubsystems( ) ARCore XR插件( ) ARKit XR插件() ARKit人脸跟踪( ) ARFoundation( ) 我应该使用什么版本? Unity版本 ARFoundation版本 2018.4 2019.4 2020.1 2020.3 2021.1 2021.2 4.2(预发行版) AR子系统 ARFoundation建立在“ ”上,并依赖于名为的独立软件包。 ARSubsystems定义了一个接口,特定于平台的实现在和软件包中。 ARFoundation变成由ARSubsystems到Unity提供的AR数据GameObject S和MonoBehavour秒。 main分支与Unity 2020.3及更高版本
资源详情
资源评论
资源推荐
收起资源包目录





































































































共 775 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8


























易三叨
- 粉丝: 54
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- MES系统与ERP接口设计解决专业技术方案.docx
- 基于网络药理学的山奈酚参与血府逐瘀汤治疗2型糖尿病作用机制研究.docx
- DB2业务规则的应用实践(3).doc
- 绿色智慧城市视角下的雄安新区农民职业培训路径研究.docx
- 自动门plc控制系统设计方案-plc自动门课程设计方案.doc
- 移动4G网络安全问题防范与对策.docx
- XX置地公司项目管理部职能说明书.doc
- 计算机网络谢希仁著课后习题答案.docx
- 贵阳市非物质文化遗产数据库建设及数字化标准采集研究.docx
- 任务书—SIEMENSSPLC夹套锅炉水温控制系统软件设计方案.doc
- 关于电力系统及其自动化技术的应用研究分析.docx
- 年度协同管理软件产业分析报告.docx
- 云计算环境下的图书馆数字资源共建共享研究-障碍.docx
- 学生成绩管理系统SQL数据库技术.doc
- 探究互联网+理念在农村小学高年级段的阅读指导.docx
- 关于区块链技术的应用与依法监管的几点思考.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论5