3DSelfie  Hansjoerg Hofer (1026632), Sebastian Metzler (0927550)
screenQuad.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 
9 public class screenQuad : MonoBehaviour {
10 
11  public RenderTexture renTex;
12  public WebCamTexture webcamTexture;
13 
14  public int width = 0;
15  public int height = 0;
16 
23  void Awake () {
24 
25  var deviceName = "";
26  if(WebCamTexture.devices.Length>1)
27  deviceName = WebCamTexture.devices[1].name;
28  else
29  deviceName = WebCamTexture.devices[0].name;
30 
31  webcamTexture = new WebCamTexture(deviceName, 1280, 720, 30);
32 
33  webcamTexture.Play();
34  }
35 
41  void Update () {
42  Graphics.Blit (webcamTexture, renTex);
43  }
44 }
WebCamTexture webcamTexture
Definition: screenQuad.cs:12
screenQuad script
Definition: screenQuad.cs:9
RenderTexture renTex
Definition: screenQuad.cs:11
int height
Definition: screenQuad.cs:15