【发布时间】:2021-08-08 06:52:33
【问题描述】:
我正在尝试通过在 Unity 中连接手部跟踪摄像头设备(Leap Motion:窗口设备管理器列表:0)和网络摄像头(窗口设备管理器列表:1)来显示 AR 视频。
Leap motion 连接使用制造商的 SDK 和包文件,因此无需额外编码即可在 Unity 中连接相机。
当我在 Unity 中连接网络摄像头(窗口设备管理器列表:1)并显示 AR 视频时出现问题。
当以下代码应用于对象时,如果 Leap motion 和 webcam camera 都连接,leap motion 被识别并作为视频输出,并且 webcam camera 的视频输出变得不可能。
如果从PC上拔下跳跃运动后只连接网络摄像头,则网络摄像头摄像头的视频输出是可能的。
我想通过在 Leap motion 和网络摄像头都连接到 PC 的对象上选择网络摄像头(窗口设备管理器列表:1)来输出视频。
由于我是Unity的初学者,我需要在下面的代码中简单地修改一下。
等待帮助。
using UnityEngine;
using System.Collections;
public class WebCam : MonoBehaviour {
// Use this for initialization
void Start () {
WebCamTexture web = new WebCamTexture(1280,720,60);
GetComponent<MeshRenderer>().material.mainTexture = web;
web.Play();
}
// Update is called once per frame
void Update () {
}
}
【问题讨论】:
标签: c# unity3d camera selection leap-motion