Log in or register to post comments

Help on camera switch

September 26, 2014 - 2:21am #1

Hi, I am now developing an app with Unity and Vuforia. I want to switch the camera when I click a button. But I found that after I switched camera, the cloud reco can not working any more. I use the following code to switch the camera:

        var dir = CameraDevice.Instance.GetCameraDirection();

        CameraDevice.Instance.Stop();
        CameraDevice.Instance.Deinit();

        switch(dir)
        {
        case CameraDevice.CameraDirection.CAMERA_DEFAULT:
        case CameraDevice.CameraDirection.CAMERA_BACK:
            CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_FRONT);
            break;
        case CameraDevice.CameraDirection.CAMERA_FRONT:
            CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_BACK);
            break;
        }

        CameraDevice.Instance.Start();

I tried to disable all other system in my app such as NGUI. But I still have this problem.

Help on camera switch

May 11, 2017 - 12:31am #3

there's no CloudRecognitionUIEventHandler script in any of vuforia sample projects.

Help on camera switch

October 1, 2014 - 6:30pm #2

The CloudReco sample app for Unity demonstrates how to switch between cameras. Check out the ChangeCameraDirection() method in the CloudRecognitionUIEventHandler script.

Log in or register to post comments