分類彙整:程式分享

Unity3d : WebCamTexture Convert To Texture2D

General case, we can use these scripts below to  display camera on the scene in the Unity3d.

  WebCamTexture wc = new WebCamTexture ();
  GameObject.Find (“/plane”).renderer.material.mainTexture = wc;
  wc.Play ();

But sometimes we want to save camera to image, or realized video streaming. We can use WebcamTexture.GetPixels() and Texture2D.SetPixels(), but you must noticed returning width and height.

繼續閱讀 Unity3d : WebCamTexture Convert To Texture2D