当前位置:网站首页>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里面


边栏推荐
- Arrays and objects in JS
- Talking about JVM (frequent interview)
- MySQL 02 初体验
- The hero of the aircraft war comes out with bullets
- Sentinel1.8.4 persistent Nacos configuration
- 兆骑科创海内外引进高层次人才,创新创业项目对接
- Uni app traversal array rendering data vertical rendering
- Whole body multifunctional massage instrument chip-dltap602sd
- was not registered for synchronization because synchronization is not active[已解决]
- MicaZ+Tinyos学习笔记(1)
猜你喜欢
随机推荐
MySQL 01 relational database design
全自动吸奶器芯片-DLTAP703SD
Personal Center - order business process
模仿线程扣除
兆骑科创海内外引进高层次人才,创新创业项目对接
Aircraft battle with enemy aircraft
Use mobaxtermto establish a two-tier springboard connection
家用静音驱蚊灯芯片-DLTAP703SD-杰力科创
Led with fan eye protection learning table lamp touch chip-dlt8s12a
MySQL 05 stored procedure
JS中的数组与对象
Nacos display service registration address error
CMD 命令
Jianmu continuous integration platform v2.5.2 release
商品名称模糊搜索:
百度地图鹰眼轨迹服务
[NPM] the "NPM" item cannot be recognized as the name of cmdlets, functions, script files or runnable programs. Please check the spelling of the name. If the path is included, make sure the path is co
用函数在Excel中从文本字符串提取数字
商品推荐和分类商品推荐
LeetCode 刷题 第二天









