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

北京网站建设开发公司哪家好免费wordpress主题下载地址

北京网站建设开发公司哪家好,免费wordpress主题下载地址,马鞍山建设网站,网站开发新动力突然接到一个LeapMotion的项目#xff0c;回想起上次做LeapMotion还是在几年前#xff0c;但是当时没有去记录#xff0c;所以这次就相当于是重新走了一遍流程。很苦恼#xff0c;赶紧记录下来。防止之后忘记。这次的需求还是比较简单的#xff0c;用手滑动控制图片序列播…突然接到一个LeapMotion的项目回想起上次做LeapMotion还是在几年前但是当时没有去记录所以这次就相当于是重新走了一遍流程。很苦恼赶紧记录下来。防止之后忘记。这次的需求还是比较简单的用手滑动控制图片序列播放。 准备 Unity版本2021.3.19f1c1LeapMotion一台 开始接入 Downloads – Page Array – Ultraleap 首先来到官网下载LeapMotion的必备组件 选择对应的设备我这台设备是比较旧的。 无脑安装 安装好后还需要来到github页面下载unity-leapmotion的插件 https://github.com/ultraleap/UnityPlugin 然后导入到unity工程中 导入后找到Capsule Hands场景就是官方的示例 针对需求查看了官网文档。有两种想法 通过XRXRI and XRHands Integration - Ultraleap documentation 去用手滑动UI。 获取手部追踪数据用程序去判断得到值然后去改变视频的帧。 最终选择了第二种方法觉得第二种比较简单。 创建HandControl.cs脚本 using System.Collections; using System.Collections.Generic; using UnityEngine;using Leap; using Leap.Unity;public class HandControl : MonoBehaviour {public static bool Gesture_left false;public static bool Gesture_right false;public static bool Gesture_up false;public static bool Gesture_down false;public static bool Gesture_zoom false;public static float movePOs 0.0f;private LeapProvider mProvider;private Frame mFrame;private Hand mHand;public ImageSwitcher imageSwitcher;private Vector3 leftPosition;private Vector3 rightPosition;public static float zoom 1.0f;[Tooltip(Velocity (m/s) of Palm )]public float smallestVelocity 1.45f;//手掌移动的最小速度[Tooltip(Velocity (m/s) of Single Direction )][Range(0, 1)]public float deltaVelocity 1.0f;//单方向上手掌移动的速度// Use this for initializationvoid Start(){mProvider FindObjectOfTypeLeapProvider() as LeapProvider;}// Update is called once per framevoid Update(){mFrame mProvider.CurrentFrame;//获取当前帧//获得手的个数//print (hand num are mFrame.Hands.Count);if (mFrame.Hands.Count 0){if (mFrame.Hands.Count 2)zoom CalcuateDistance(mFrame);if (mFrame.Hands.Count 1)LRUDGestures(mFrame, ref movePOs);}}float CalcuateDistance(Frame mFrame){Gesture_zoom true;Gesture_left false;Gesture_right false;float distance 0f;//print (Two hands);foreach (var itemHands in mFrame.Hands){if (itemHands.IsLeft){leftPosition itemHands.PalmPosition;//print (leftPosition leftPosition);}if (itemHands.IsRight){rightPosition itemHands.PalmPosition;//print (rightPosition rightPosition);}}if (leftPosition ! Vector3.zero rightPosition ! Vector3.zero){Vector3 leftPos new Vector3(leftPosition.x, leftPosition.y, leftPosition.z);Vector3 rightPos new Vector3(rightPosition.x, rightPosition.y, rightPosition.z);distance 10 * Vector3.Distance(leftPos, rightPos);//print(distance distance);}if (distance ! 0)return distance;elsereturn distance 1;}void LRUDGestures(Frame mFrame, ref float movePOs){Gesture_zoom false;foreach (var item in mFrame.Hands){int numFinger item.Fingers.Count;//print (item is numFinger);//print(hand are isOpenFullHand (item));// print (isOpenFullHands is isOpenFullHands(item));if (item.GrabStrength 1){}else if (item.GrabStrength 0){//print (num is 5, open your hand);//print(PalmVelocity item.PalmVelocity);//print(PalmPosition item.PalmPosition);movePOs item.PalmPosition.x;if (isMoveLeft(item)){Gesture_left true;Gesture_right false;//print(move left);}else if (isMoveRight(item)){Gesture_left false;Gesture_right true;//print(move Right);}else if (isMoveUp(item)){Gesture_left false;Gesture_right false;print(move Up);imageSwitcher.PreviousImage();}else if (isMoveDown(item)){Gesture_left false;Gesture_right false;print(move Down);imageSwitcher.NextImage();}else if (isMoveForward(item)){Gesture_left false;Gesture_right false;print(move Forward);imageSwitcher.PreviousImage();}else if (isMoveBack(item)){Gesture_left false;Gesture_right false;print(move back);imageSwitcher.NextImage();}}}}private bool isStone(Hand hand){//print (hand.GrabAngle hand.GrabAngle);return hand.GrabStrength 2.0f;}//是否抓取public bool isGrabHand(Hand hand){return hand.GrabStrength 0.8f; //抓取力 }//hand move four directionpublic bool isMoveRight(Hand hand){return hand.PalmVelocity.x deltaVelocity !isStationary(hand);}// 手划向右边public bool isMoveLeft(Hand hand){//print (hand.PalmVelocity.x );return hand.PalmVelocity.x -deltaVelocity !isStationary(hand);}//手向上 public bool isMoveUp(Hand hand){//print (hand.PalmVelocity.y hand.PalmVelocity.y);return hand.PalmVelocity.y deltaVelocity !isStationary(hand);}//手向下 public bool isMoveDown(Hand hand){return hand.PalmVelocity.y -deltaVelocity !isStationary(hand);}//手向前public bool isMoveForward(Hand hand){//print (hand.PalmVelocity.z);return hand.PalmVelocity.z deltaVelocity !isStationary(hand);}//手向后 public bool isMoveBack(Hand hand){return hand.PalmVelocity.z -deltaVelocity !isStationary(hand);}//固定不动的public bool isStationary(Hand hand){return hand.PalmVelocity.magnitude smallestVelocity; //Vector3.Magnitude返回向量的长度}} 创建ImageSwitcher.cs脚本 using UnityEngine; using UnityEngine.UI; // 引入UI命名空间public class ImageSwitcher : MonoBehaviour {public Image displayImage; // 用于显示图片的Image组件public Sprite[] images; // 存储所有图片的数组private int currentImageIndex 0; // 当前显示的图片索引void Start(){// 初始化时显示第一张图片if (images.Length 0){displayImage.sprite images[currentImageIndex];}}// 切换到下一张图片public void NextImage(){if (images.Length 0){currentImageIndex (currentImageIndex 1) % images.Length; // 使用模运算确保索引循环displayImage.sprite images[currentImageIndex];}}// 切换到上一张图片public void PreviousImage(){if (images.Length 0){currentImageIndex (currentImageIndex - 1 images.Length) % images.Length; // 使用模运算确保索引循环displayImage.sprite images[currentImageIndex];}} } 将两个脚本挂载在场景中并赋值 image switcher中的images将准备好的序列帧拖入 创建Canvas和Image。将image拖入image Switcher中 最终场景是这样的结构。使用的场景是官方的Capsule Hands。 成功运行。这个项目比较简单开发的时候也没有遇到坑在此记录下防止后面忘了流程。 官方文档 Get started with our plugins for XR developers - Ultraleap documentation
http://www.zqtcl.cn/news/756004/

相关文章:

  • 网站access数据怎么做高端品牌网站建设的目的
  • 外贸买家网站凯里网站建设流程
  • 网站一年要多少钱国外的建筑设计网站
  • 手游发号网站模板ic外贸网站建设
  • 珠海网站制作案例tp5 商城网站开发
  • 母婴用品网站建设规划上海市建设工程 安全协会网站
  • 做室内设计特别好的网站网站服务器租用恒创
  • 慕课网站开发文档wordpress上传到空间
  • 行业垂直网站开发漳州最便宜的网站建设价格
  • 高级网站设计效果图网站设计制作哪些
  • 惠山区住房和建设厅网站营销推广方式都有哪些
  • 做网贷网站多少钱wordpress首页短代码
  • 网站网格湖南网页
  • 做网站的知名品牌公司用ps切片做网站
  • 中学网站模板下载番禺外贸网站建设
  • 常州网站seo代理加盟郑州浩方网站建设智联招聘
  • 小型网站制作网站开发做什么费用
  • seo网站论文社交app开发公司
  • 企业宣传网站建设图示《高性能网站建设》
  • 福州志愿者官方网站怎么做erp管理系统介绍
  • 高端网站建设费用情况广州开发区控股集团有限公司
  • 精湛的网站设计云南网招聘
  • 南昌网站建设公司行情Wordpress添加分页按钮
  • 论坛网站建设流程wordpress速度优化插件
  • PHP套模板做网站建设银行保定分行网站
  • 怎样免费注册网站域名wordpress网站回调域
  • 东莞个人免费建网站乐清网约车事件
  • 备案查询网站网站的登录弹窗怎么做
  • 网站开发 mvc北京建设工程主管部门网站
  • 淮安建设机械网站制作代理公司注册需要多少钱