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;
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
I put my solution here, try to build 32bit Unity3d and plugin. Recently I build Unity3d project in Linux 64bit. The project need to analysis web camera it only support MJPEG format, MJPG format seems could not be captured by using WebCamTextrure() directly on Linux. (By the way, MJPG format seems can be analysis on Windows 32bit/64bit normally.) So I developed plugin that using libjpeg to analysis web camera.
繼續閱讀 Unity3d Plugin issue on CentOS 64bit
Recently, I need to write Unity3d plugin. My partner develops Unity3d Project in Windows system, but whole project needs to run in Linux system. This article will show you how to include Unity3d plugin under Windows and Linux.
First of all, you need to know that extension of Unity3d plugin is different in Windows and Linux. For example, we want to create a “cleanwind” plugin, in Windows it’s “cleanwind.dll“, but in Linux it’s “libcleanwind.so“.Here point is, the prefix “lib” must exist in Linux and not show in Windows.
繼續閱讀 Unity3d Plugin in Windows and Linux