# AR Foundation Samples
Example projects that use [*AR Foundation 4.2*](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/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/com.unity.xr.arsubsystems@4.2/manual/index.html))
* ARCore XR Plug-in ([documentation](https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.2/manual/index.html))
* ARKit XR Plug-in ([documentation](https://docs.unity3d.com/Packages/com.unity.xr.arkit@4.2/manual/index.html))
* ARKit Face Tracking ([documentation](https://docs.unity3d.com/Packages/com.unity.xr.arkit-face-tracking@4.2/manual/index.html))
* ARFoundation ([documentation](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/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/com.unity.xr.arsubsystems@4.2/manual/index.html). ARSubsystems defines an interface, and the platform-specific implementations are in the [ARCore](https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.2/manual/index.html) and [ARKit](https://docs.unity3d.com/Packages/com.unity.xr.arkit@4.2/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/com.unity.xr.arfoundation@4.2/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/com.unity.xr.arfoundation@4.0/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/com.unity.xr.arfoundation@4.0/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及更高版本
资源详情
资源评论
资源推荐
收起资源包目录
arfoundation-samples:基于AR Foundation的Unity项目的示例内容 (775个子文件)
Cylinder.arobject 1.11MB
Cube.arobject 958KB
Unity.XR.Samples.Multipeer.asmdef 319B
ProjectSettings.asset 21KB
QualitySettings.asset 7KB
InputManager.asset 6KB
EditorBuildSettings.asset 5KB
XRGeneralSettings.asset 3KB
GraphicsSettings.asset 2KB
ReferenceImageLibrary.asset 2KB
Physics2DSettings.asset 1KB
NavMeshAreas.asset 1KB
DynamicsManager.asset 1KB
EditorSettings.asset 1KB
PackageManagerSettings.asset 1003B
ReferenceObjectLibrary.asset 859B
UnityConnectSettings.asset 853B
PresetManager.asset 824B
AR Kit Settings.asset 443B
AR Core Settings.asset 437B
AR Core Loader Settings.asset 412B
AR Kit Loader Settings.asset 411B
TagManager.asset 404B
AR Core Loader.asset 403B
AR Kit Loader.asset 402B
AudioManager.asset 377B
VFXManager.asset 273B
TimeManager.asset 206B
VersionControlSettings.asset 188B
NetworkManager.asset 159B
XRSettings.asset 158B
ClusterInputManager.asset 120B
XRPackageSettings.asset 73B
DisplayDepthImage.cs 18KB
CheckAvailableFeatures.cs 15KB
ARKitBlendShapeVisualizer.cs 13KB
MeshClassificationFracking.cs 13KB
CpuImageSample.cs 12KB
ARSceneSelectUI.cs 11KB
ARWorldMapController.cs 10KB
PrefabImagePairManager.cs 8KB
BoneController.cs 8KB
FeaturesReporting.cs 8KB
ThermalStateHandling.cs 8KB
DynamicLibrary.cs 7KB
HDRLightEstimation.cs 7KB
EnableGeoAnchors.cs 7KB
ARCoreSessionRecorder.cs 6KB
CustomConfigurationChooser.cs 6KB
ARKitCoachingOverlay.cs 6KB
DisplayFaceInfo.cs 6KB
HDRLightEstimationUI.cs 6KB
DisplayARSessionInformation.cs 6KB
ScreenSpaceJointVisualizer.cs 5KB
ThermalStateForIOS.cs 5KB
CollaborativeSession.cs 5KB
ARAllPointCloudPointsParticleVisualizer.cs 5KB
DynamicPrefab.cs 4KB
CollaborationBuildPostprocessor.cs 4KB
SupportChecker.cs 4KB
ARFeatheredPlaneMeshVisualizer.cs 4KB
CameraConfigController.cs 4KB
TrackedImageInfoManager.cs 4KB
AnchorCreator.cs 4KB
MCSession.cs 4KB
ARCoreFaceRegionManager.cs 3KB
BasicLightEstimation.cs 3KB
FixationPoint2DVisualizer.cs 3KB
SwitchPointCloudVisualizationMode.cs 3KB
HumanBodyTracker.cs 3KB
NSString.cs 3KB
PlaneClassificationLabeler.cs 3KB
EyePoseVisualizer.cs 3KB
RotationController.cs 3KB
NSData.cs 3KB
FacingDirectionManager.cs 3KB
ScaleController.cs 3KB
FixationPoint3DVisualizer.cs 2KB
MakeAppearOnPlane.cs 2KB
PlaceOnPlane.cs 2KB
AnchorInfoManager.cs 2KB
BasicLightEstimationUI.cs 2KB
PlaneDetectionController.cs 2KB
TestBodyAnchorScale.cs 2KB
Logger.cs 2KB
PlaceMultipleObjectsOnPlane.cs 2KB
ToggleMeshClassification.cs 2KB
InputSystem_PlaceOnPlane.cs 2KB
CollaborationNetworkingIndicator.cs 2KB
CheckRuntimeDepth.cs 2KB
NSError.cs 2KB
DisableVerticalPlanes.cs 2KB
FaceMaterialSwitcher.cs 1KB
CameraSwapper.cs 1KB
ProjectileLauncher.cs 1KB
Tooltip.cs 1KB
DisplayTrackingState.cs 1KB
ToggleCameraFacingDirection.cs 1KB
CameraGrain.cs 1KB
CanvasTextManager.cs 1KB
共 775 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
易三叨
- 粉丝: 48
- 资源: 4609
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 25混合A星算法路径规划Hybrid-Astar 以车辆的运动学模型为节点,以当前点到终点的Astar距离和RS距离两者最大的距离作为H(n)函数的估计代价,使用matlab实现(2016a以上版本)
- 光储电压电流双环并网控制MATLAB仿真,包含光伏阵列模型、MPPT升压回路、储能电池模型、电压电流双环控制模型等,模型中各个环节均有注释,还有对仿真的讲解Word文件
- 2024年下半年小红书热门行业趋势报告解析
- 模块化多电平流器,MMC-HVDC直流输电系统,单个桥臂4个子模块(5电平),采用载波移相调制 simulink仿真模型 直流电压4KV,功率等级5MW 流站1:定直流母线电压控制+定无功功率控制;
- 【PMSM自抗扰控制】 PMSM 永磁同步电机 ADRC 自抗扰控制 matlab simulink 仿真 (1)采用转速、电流双闭环控制; (2)外环转速环,采用ADRC控制器控制; (3)内环电
- PFC单轴压缩声发射模拟演化规律及胶结破坏能监测
- 红外小目标检测中的深度学习方法:HCF-Net层次化上下文融合网络模型及其应用
- 基于时变干扰观测器和调节边界层厚度滑模控制的微机电系统陀螺仪鲁棒控制方法
- 源码-基于SSM的儿童玩具商城系统的设计与实现
- CNC机床预测健康管理及故障诊断数据集构建与分类算法研究
- yolo+吸烟数据集+目标检测+机器视觉识别+5000张图片抽烟识别数据集
- 星环大数据平台手册详细使用过程
- 机器学习中基于Adaboost的MAGIC伽马射电望远镜数据分类与性能评估
- MATLAB实现图像处理与机器视觉项目任务-Swinburne大学机器视觉课程作业
- 脑启发决策脉冲神经网络及其应用于无人机自主任务
- 【Unity天气和天空系统插件】Enviro 3 - Sky and Weather
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论5