alvar_init() private method

private alvar_init ( int width, int height ) : void
width int
height int
return void
Beispiel #1
0
    void Start()
    {
        // Debug print
        print(selectedCam);
        print(WebCamTexture.devices[selectedCam].name);

        // Initialize the webCamTexture and apply the webcam stream on the object
        webCamTexture = new WebCamTexture();
        renderer.material.mainTexture = webCamTexture;
        webCamTexture.deviceName      = WebCamTexture.devices[selectedCam].name;

        // Start streaming the images captured by the webcam into the texture
        webCamTexture.Play();

        // Initialisation of the bridge components
        ALVARBridge.alvar_init(webCamTexture.width, webCamTexture.height);
        data      = new Color32[webCamTexture.width * webCamTexture.height];
        imageData = new int[data.Length * 3];
    }