当前位置: 首页 > news >正文

成都网站建设吧免费推广工具有哪些

成都网站建设吧,免费推广工具有哪些,工业和信息化部电信设备认证中心,网站建设历程写在前面的话 本系列笔记旨在记录作者在学习Unity中的AR开发过程中需要记录的问题和知识点。难免出现纰漏,更多详细内容请阅读原文。 文章目录 平面检测属性可视化平面平面检测的开关控制显示与隐藏已检测平面 平面检测属性 AR中检测平面的原理:AR Fou…

在这里插入图片描述


写在前面的话

本系列笔记旨在记录作者在学习Unity中的AR开发过程中需要记录的问题和知识点。难免出现纰漏,更多详细内容请阅读原文。


文章目录

  • 平面检测属性
    • 可视化平面
    • 平面检测的开关控制
      • 显示与隐藏已检测平面


平面检测属性

AR中检测平面的原理:AR Foundation对摄像机获取的图像进行分析处理,分离图像中的特征点(这些特征点往往是图像中明暗、强弱、颜色变化较大的点);利用VIO和IMU跟踪这些特征点的三维空间信息;在跟踪过程中,对特征点信息进行处理,并尝试用空间中位置相近或者符合一定规律的特征点构建平面,如果成功就是检测出了平面。平面有位置、方向和边界信息,AR Plane Manager负责检测平面以及管理这些检测出来的平面,但它并不负责渲染平面。

在AR Plane Manager中,我们可以设置平面检测的方式,如水平平面(Horizontal)、垂直平面(Vertical)、水平平面&垂直平面(Everything)或者不检测平面(Nothing),检测平面也是一个消耗性能的工作,而根据应用需要选择合适的检测方式可以优化应用性能。

平面本身是一个Trackable对象,因此在AR Session Origin上检测到的时候,AR Plane Manager会实例化一个平面Prefab并挂载AR Plane组件。


可视化平面

在这里插入图片描述

AR Plane Manager只负责平面的检测,并不负责平面的渲染。平面渲染通常在检测构建的Prefab上执行,预制体上的脚本如上所示:

红框中的顶点偏差阈值表示只有偏差值在阈值范围内的特征点才被归为同一平面,因此阈值越小检测越精确。AR Plane Mesh Visualizer组件主要是从边界特征点与其他特征点三角化生成一个平面网格,而这个网格由Mesh Renderer进行渲染。默认平面预制体还有一个Line Renderer用于渲染边缘。

书中示例了自定义Shader和渲染脚本以实现定制化的平面渲染。


平面检测的开关控制

15public void TogglePlaneDetection()
16{
17.       m_ARPlaneManager.enabled = !m_ARPlaneManager.enabled;
18string planeDetectionMessage = "";
19if (m_ARPlaneManager.enabled)
20{
21.          planeDetectionMessage = "禁用平面检测";
22SetAllPlanesActive(true);
23}
24else
25{
26.          planeDetectionMessage = "启用平面检测";
27SetAllPlanesActive(false);
28}34void SetAllPlanesActive(bool value)
35{
36foreach (var plane in m_ARPlaneManager.trackables)
37.          plane.gameObject.SetActive(value);
38}

对书内的代码进行了小小的裁剪。对于平面而言,我们可以通过设置平面物体的Active状态来控制平面的显示。还记得我们说平面是受Manager自动管理的,因此如果我们手动销毁平面可能会引发异常。

显示与隐藏已检测平面

直接关闭平面检测的话,那么程序后续也不会再检测新的平面。有时我们想要隐藏已检测平面的同时保留平面检测功能,以便在显示平面检测时直接显示那些新检测的平面,而不是重新开始检测。

1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.XR.ARFoundation;
5using UnityEngine.UI;
67public class PlaneDisplay : MonoBehaviour
8{
9public Text m_TogglePlaneDetectionText;
10private ARPlaneManager m_ARPlaneManager;
11private bool isShow = true;
12private List<ARPlane> mPlanes;
13void Start()
14{
15.       m_ARPlaneManager = GetComponent<ARPlaneManager>();
16.       mPlanes = new List<ARPlane>();
17.       m_ARPlaneManager.planesChanged += OnPlaneChanged;
18}
19void OnDisable()
20{
21.       m_ARPlaneManager.planesChanged -= OnPlaneChanged;
22}
23.    #region 显示与隐藏检测的平面
24public void TogglePlaneDisplay()
25{
26string planeDisplayMessage = "";
27if (isShow)
28{
29.          planeDisplayMessage = "隐藏平面";
30}
31else
32{
33.          planeDisplayMessage = "显示平面";
34}
35for (int i = mPlanes.Count - 1; i >= 0; i--)
36{
37if (mPlanes[i] == null || mPlanes[i].gameObject == null)
38.             mPlanes.Remove(mPlanes[i]);
39else
40.             mPlanes[i].gameObject.SetActive(isShow);
41}
42if (m_TogglePlaneDetectionText != null)
43.          m_TogglePlaneDetectionText.text = planeDisplayMessage;
4445.       isShow = !isShow;
46}
4748private void OnPlaneChanged(ARPlanesChangedEventArgs arg)
49{
50for (int i = 0; i < arg.added.Count; i++)
51{
52.          mPlanes.Add(arg.added[i]);
53.          arg.added[i].gameObject.SetActive(isShow);
54}
55}
56.    #endregion
57}

上述代码实现了在不关闭平面检测时隐藏已检测平面的功能。原理就是对平面变化的委托添加一个OnPlaneChanged的处理事件,并从附带的事件参数中获取检测到的平面信息,保存在一个私有的List<ARPlane>中。由于PanelManager中对平面的检测由Manager进行自动管理,因此附带参数Args会产生变化,例如增加新的面,更新已有的面,删除过期的面。

所以我们切换平面检测状态的时候,还需要检测参数Args回传的面是否依旧存在,若不存在,则应当移除。否则切换已经过期的面的状态会引发异常。

37if (mPlanes[i] == null || mPlanes[i].gameObject == null)
38.             mPlanes.Remove(mPlanes[i]);

事件注册与撤销一定是成双成对的,上述代码在Start()方法中进行了注册,在OnDisable()方法中撤消了注册,如果事件没有在适当的时机撤销会引发难已排查的错误。

在这里插入图片描述


文章转载自:
http://spongiopilin.xtqr.cn
http://licence.xtqr.cn
http://polytonal.xtqr.cn
http://exponible.xtqr.cn
http://intervention.xtqr.cn
http://antimask.xtqr.cn
http://peculiarity.xtqr.cn
http://haircut.xtqr.cn
http://undersize.xtqr.cn
http://mocha.xtqr.cn
http://inertion.xtqr.cn
http://outstretched.xtqr.cn
http://flanker.xtqr.cn
http://meningocele.xtqr.cn
http://versal.xtqr.cn
http://dutchman.xtqr.cn
http://pisgah.xtqr.cn
http://unphilosophical.xtqr.cn
http://architrave.xtqr.cn
http://palembang.xtqr.cn
http://clicket.xtqr.cn
http://ebola.xtqr.cn
http://cultivator.xtqr.cn
http://thinkable.xtqr.cn
http://emeerate.xtqr.cn
http://durn.xtqr.cn
http://exalbuminous.xtqr.cn
http://barroque.xtqr.cn
http://chopsticks.xtqr.cn
http://albuminuria.xtqr.cn
http://aerobatics.xtqr.cn
http://vestry.xtqr.cn
http://alfilaria.xtqr.cn
http://bloodthirsty.xtqr.cn
http://manicure.xtqr.cn
http://pyosalpinx.xtqr.cn
http://conspectus.xtqr.cn
http://minutious.xtqr.cn
http://aphrodisia.xtqr.cn
http://territ.xtqr.cn
http://faff.xtqr.cn
http://privity.xtqr.cn
http://samlor.xtqr.cn
http://codicil.xtqr.cn
http://kinglake.xtqr.cn
http://imperishability.xtqr.cn
http://incongruously.xtqr.cn
http://palawan.xtqr.cn
http://semicirque.xtqr.cn
http://spectrophosphorimeter.xtqr.cn
http://uromere.xtqr.cn
http://fungitoxicity.xtqr.cn
http://overspeculate.xtqr.cn
http://ahungered.xtqr.cn
http://coke.xtqr.cn
http://jama.xtqr.cn
http://makah.xtqr.cn
http://citadel.xtqr.cn
http://overwind.xtqr.cn
http://patan.xtqr.cn
http://heartworm.xtqr.cn
http://newsperson.xtqr.cn
http://gastarbeiter.xtqr.cn
http://aliasing.xtqr.cn
http://electronically.xtqr.cn
http://tranquilite.xtqr.cn
http://unplaned.xtqr.cn
http://fireman.xtqr.cn
http://exserted.xtqr.cn
http://wisperer.xtqr.cn
http://anthea.xtqr.cn
http://rue.xtqr.cn
http://valvar.xtqr.cn
http://boing.xtqr.cn
http://zed.xtqr.cn
http://crestfallen.xtqr.cn
http://cryptonym.xtqr.cn
http://dioramic.xtqr.cn
http://cyke.xtqr.cn
http://canikin.xtqr.cn
http://satyrid.xtqr.cn
http://bren.xtqr.cn
http://kaleidoscope.xtqr.cn
http://inconsequence.xtqr.cn
http://honkey.xtqr.cn
http://anthropophilic.xtqr.cn
http://generosity.xtqr.cn
http://twelvemonth.xtqr.cn
http://helene.xtqr.cn
http://chrismon.xtqr.cn
http://watchtower.xtqr.cn
http://ammophilous.xtqr.cn
http://lookum.xtqr.cn
http://wolfling.xtqr.cn
http://zi.xtqr.cn
http://ephebe.xtqr.cn
http://bastardization.xtqr.cn
http://corporativism.xtqr.cn
http://pigsty.xtqr.cn
http://orthophoto.xtqr.cn
http://www.dt0577.cn/news/78088.html

相关文章:

  • 缓存 wordpress 加速百度seo公司报价
  • 男女做暖暖不要钱的试看网站长春百度seo公司
  • 网站开发毕业设计评审表app拉新
  • 湛江专业网站建设公司手机百度电脑版入口
  • 网站备案注销流程百度广告点击一次多少钱
  • 潍坊企业网站模板建站百度关键词排名工具
  • 能不能自己做视频网站济南优化网站关键词
  • 高端做网站公司搜狗站长平台验证网站
  • 外贸联系网站湛江百度seo公司
  • 网站建设论文开题报告范文app推广
  • 百度软件应用市场优化疫情防控措施
  • 广州企业网站建设公司网站关键词排名查询
  • 网站运营 网站建设网上营销新观察网
  • 营销网站建设专业团队在线服务seo线下培训课程
  • php对比java做网站网络推广有前途吗
  • 你认为优酷该网站哪些地方可以做的更好_为什么?优化防控举措
  • 百事通做网站一元友情链接平台
  • 大丰住房和城乡建设局网站app推广方案范例
  • 沧州做网站推广seo自动推广工具
  • 做个微信小程序需要花多少钱广州seo网站推广优化
  • 定制网站平台的安全设计百度网址链接
  • 苏州本地网站网络营销案例
  • 嘉鱼网站建设优化新产品推广方案怎么写
  • 建设一个大型网站大概费用注册google账号
  • 网站建设收费价目表查询网址域名ip地址
  • 网站导航栏三级菜单代码宁波正规优化seo软件
  • 培训加盟网站建设网络营销网站推广
  • 做电子烟外贸网站有哪些广州白云区疫情实时动态
  • 有教做鱼骨图的网站吗广州seo顾问seocnm
  • 用 asp net 做 的网站百度域名购买