当前位置:网站首页>Unity显示Kinect捕获的镜头
Unity显示Kinect捕获的镜头
2022-07-27 16:22:00 【Miracle Fan】
Unity显示Kinect捕获的镜头
文章目录
1.创建显示图形对象
1.1创建RawImage

1.2 将RawImage拓展到整个画板

按住Alt键选择上图右侧的框,再点击右下角的stretch拉伸按钮

1.3 创建脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ImageViewer : MonoBehaviour
{
public MultiSourceManager multiSourceManager;
public RawImage rawImage;
void Update()
{
rawImage.texture = multiSourceManager.GetColorTexture();//获取彩色摄像头的数据
}
}
1.4 创建MultiManager对象
先创建空物体,再为空物体添加Multi SourceManager脚本

1.5将对象实例化
拖动MultiManager和RawImage对象到脚本实例对象中。

1.6 运行游戏
此时显示图像的为反转的,我们需要为RawImage添加Material修改反转

2. 修改RawImage的Material
2.1创建材质

2.2 实例化
将材质拖入RawImage对象,并取消Raycast Target勾选

2.3 再次运行

3. plus(第一步)导入Kinect sdk
将如下的文件导入进unity的asset里面


边栏推荐
- js中的函数与DOM获取元素和事件属性的使用
- Uploading and downloading of files
- CMD command
- Hash、Set、List、Zset、BitMap、Scan
- 百度地图技术概述,及基本API与WebApi的应用开发
- MySQL 06 transaction, view, index, backup and recovery
- filebeat.yml配置文件关于多个服务的配置问题
- `this.$ Emit ` the child component passes multiple parameters to the parent component
- WinForm remove the close button in the upper right corner
- ES6-新增方法
猜你喜欢
随机推荐
MySQL 04 高级查询(二)
商品评论信息与评论信息分类
pygame飞机大战游戏背景实现
nacos显示服务注册地址错误
EN 1155 building hardware swing door opener - CE certification
浴室带除雾化妆镜触摸芯片-DLT8T10S
Product recommendation and classified product recommendation
MongoDB
npm的身份证和依赖
JS中的数组与对象
Typescript installation
Talking about JVM (frequent interview)
`this.$ Emit ` the child component passes multiple parameters to the parent component
Wechat payment and payment callback
兆骑科创海内外引进高层次人才,创新创业项目对接
飞机大战英雄出场加子弹实现
MySQL 01 relational database design
Hash、Set、List、Zset、BitMap、Scan
Led learning eye protection table lamp touch chip-dlt8t10s-jericho
正则表达式的扩展









