Unity + Logicool Qcam Pro 9000

ロジクール キューカムプロ9000 QCAM-200S

ロジクール キューカムプロ9000 QCAM-200S

  • 2007年発売
  • 30fps
  • カメラの移動と画面への反映へのラグは感じる
  • Logicoolのサイトから適当に現在サポートしているカメラからソフトウェアをDL
  • Win7用とか書いてあるけど、動くやろ!とインストール
  • 動いた。10年前くらいに見た懐かしいカメラ操作UIがあった

Unityで動かしてみる

  • WebCamTexture
using UnityEngine;
using System.Collections;

public class Cam : MonoBehaviour
{
    // Gets the list of devices and prints them to the console.
    void Start()
    {
        WebCamDevice[] devices = WebCamTexture.devices;
        for (int i = 0; i < devices.Length; i++)
            Debug.Log(devices[i].name);
    }
}
// Starts the default camera and assigns the texture to the current renderer
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        WebCamTexture webcamTexture = new WebCamTexture("Logicool Qcam Pro 9000");
        Renderer renderer = GetComponent<Renderer>();
        renderer.material.mainTexture = webcamTexture;
        webcamTexture.Play();
    }
}
  • バイス一覧を知っておく
  • WebCamTextureのコンストラクタ引数にデバイス名を入れる
  • Planeにカメラ映像を映す
  • 映った。ラグは公式のLogicoolソフトウェアと同じくらい

f:id:peroon:20190724024518j:plain