List
Unity - usb cam 사용 문의
Posted Date: 2023-08-24 6:13     Edited Date: 2023-08-25 8:00     Writer: bones11201008

Please provide your development details as below;

1. SDK Version: 6.0.1
2. Development Environment: (eg. Unity-Android, Unity-iOS, Native Android, Native iOS): Windows
3. Tracker/Scanner:
4. License Type(Free / Pro-One Time Fee / Pro-Subscription / Enterprise): Free
5. Target Device(Optional):

안녕하세요.

공식적으로 Windows 지원하지 않는 것으로 알고는 있지만 개발중에는 사용이 필요해서 문의드립니다.

AR Device 에서 테스트 하기 전에 Windows 상에서 먼저 검증 진행중입니다.

built-in webcam(CAM A) 이 있는 Windows 10 노트북에 usb 케이블로 webcam(CAM B) 이 하나 더 장착되어 있는 환경입니다.

Unity Editor 에서 Play 시에는 AR Camera configuration 에서 CAM B 를 선택했을 때 CAM B 가 동작하는 것이 보이는데,

CAM B 가 선택된 상태에서 빌드하여 생성된 exe 파일을 실행하면 CAM A 가 동작합니다.

exe 에서 CAM B 를 사용하기 위해 추가로 설정 필요한 항목이 있을까요?

Posted Date: 2023-08-25 8:00     Edited Date: 2023-08-25 8:00     Writer: sejin

MAXST AR SDK에 관심을 가져주셔서 감사합니다. 

 

maxst_CameraDevice_start() 에 원하는 카메라 타입과 해상도를 입력하면 됩니다.

카메라 타입에는 WebCamTexture.devices에서 웹캠의 index를 찾아 대입하세요.

 

수정된 CameraDevice.cs의 Start() 함수입니다.

CameraDevice.cs >

public ResultCode Start() {

            int cameraType = 0;
            WebCamDevice[] devices = WebCamTexture.devices;
            for (int i = 0; i < devices.Length; i++)
            {
                string WEB_CAM_NAME = "WEB CAM NAME";
                if (devices[i].name == WEB_CAM_NAME)
                {
                    cameraType = i;
                    break;
                }
            }

            // Resolution1280x720
            preferredWidth = 1280;
            preferredHeight = 720;

            return (ResultCode)NativeAPI.maxst_CameraDevice_start(cameraType, preferredWidth, preferredHeight);

}

추가적인 질문이 있으시면 언제든지 문의주세요.

 

Best regards

Shelden

MAXST Support Team