vr_video_camera/main_info.md
njord cc79b404e5 create file
draft from chat.openai.com
2023-10-25 15:18:26 +01:00

2.8 KiB

1. Setup Development Environment:

a-1. Oculus Development Hub (ODH):

  • Download and install the Oculus Development Hub (ODH).
  • Connect your Meta Quest 2 to your PC using a USB-C cable.
  • Use ODH to enable Developer Mode on your Quest 2.

a-2.

  • Download and install the Meta Quest Developer Hub (MQDH)
  • Connect your Meta Quest 2 to your PC using a USB-C cable.
  • Use MQDH to enable Developer Mode on your Quest 2.

b. Unity Setup:

  • Install Unity Hub and then install Unity (preferably version 2019.4 or newer).
  • Create a new Unity project.
  • Go to Asset Store and download the Oculus Integration package.
  • Import the package into your project.

c. Android SDK & NDK:

  • Install Android Studio.
  • Open Android Studio, go to SDK Manager, and ensure you have the required SDK and NDK versions installed.

2. USB OTG Camera Integration:

a. Android Manifest Permissions:

Add the necessary permissions to the AndroidManifest.xml:

<uses-permission android:name="android.permission.USB_HOST" />
<uses-feature android:name="android.hardware.usb.host" android:required="true" />

b. Accessing USB Camera:

You can use the UVCCamera library. Here's a basic way to integrate it:

  1. Clone the UVCCamera repository.
  2. Import the library into your Unity project.
  3. Create a bridge class in Unity to interface with the library.

3. Display Camera Feed in VR:

a. Create a 3D Plane in Unity:

  • In the Unity hierarchy, right-click and create a 3D Plane.
  • This will be used to display the camera feed.

b. Display Camera Feed:

public RawImage displayImage; // Drag your RawImage component here in the inspector

void UpdateCameraFeed(Texture cameraTexture)
{
    displayImage.texture = cameraTexture;
}

4. User Interface & Controls:

a. Basic UI:

  • Use Unity's UI system to create buttons for connecting/disconnecting the camera.
  • Use Oculus Integration's OVRInputModule to make the UI interactive in VR.

b. VR Controls:

  • Use the OVRInput class from Oculus Integration to detect button presses and controller movements.

5. Testing:

  • Build and run your Unity project for the Android platform.
  • Wear your Quest 2 and test the app's functionality.

6. Deployment:

7. Considerations:

  • Regularly test with different USB OTG cameras to ensure broad compatibility.
  • Monitor battery usage and optimize as necessary.