Unity 3D Game Engine – Android – Native Camera Access
Inside Hierarchy create the scene with:
1. Main Camera
2. Plane in front of the Camera, attach the script ‘GetcameraImg.js’
GetcameraImg.js
// Starts the default camera and assigns the texture to the current renderer function Start () { var webcamTexture : WebCamTexture = WebCamTexture(); // assign the webcam source to var renderer.material.mainTexture = webcamTexture; // render over material texture webcam source webcamTexture.Play(); // Play the webcam } function Update () { }
3. You can flip, mirror, rotate the 3D Plane to flip, mirror, rotate the webcam texture!