RSS

Tag Archives: WebCamTexture

Unity3D webcam rendering: incorrect rotation and flip using WebCamTexture


When rendering webcam as textures, Unity3D ships with a useful WebCamTexture class, the typical use of this class is as follows:

  • Create a GUITexture object: in unity menu:  GameObject  arrow, dash, right icon  Create Other  arrow, dash, right icon  GUI Texture, let’s name it CamTexture;
  • Create a C# script, let’s also name it CamTexture.cs
  • In the script, create an instance of WebCamTexture:

    WebCamTexture webcamTexture;

  • In the Start() function, add below code:

    webcamTexture = new WebCamTexture();               
    guiTexture.texture = webcamTexture;       
    webcamTexture.Play();

image
Wrongly oriented CAM View
   

image
Actual physical view

Advertisements
 
3 Comments

Posted by on November 4, 2013 in Programming, Unity 3d

 

Tags: , , , , , , , , , ,