全球优质服务器购买

为用户应用推荐适合的服务器,针对需求定制,将质量做到更好

香港服务器

香港CN2优化带宽,国内访问快

CPU:I3-2120(2核心4线程)

内存:4G DDR3内存

硬盘:1T HDD

带宽:10M优化、10M国际

IP数:1个

价格:699/月

美国服务器

美国洛杉矶高性价比服务器

CPU:I3-2120(2核心4线程)

内存:4G DDR3内存

硬盘:1T HDD

带宽:30M优化/100M普通

IP数:1个(10G防护)

价格:499/月

香港站群服务器

香港多IP站群服务器租用

CPU:E3-1230V2(4核

内存:8G DDR3内存

硬盘:240G SSD/1T SATA

带宽:10M优化

IP数:125个IP(1/2C)

价格:1099/月

美国站群服务器

美国多IP站群服务器租用

CPU:E3-1230V2(4核)

内存:16G DDR3内存

硬盘:1T HDD/240G SSD

带宽:30M优化/100M普通

IP数:125个IP(1/2C)

价格:999/月

unity 打开摄像头(图像倒立的变换) 和显示所有摄像头的名称_i++

using UnityEngine;  
using System.Collections;  

public class DetectDeviceList : MonoBehaviour {  

	// Use this for initialization  
	void Start () {  

		WebCamTexture webcamTexture = new WebCamTexture ();  

		//如果有后置摄像头,调用后置摄像头  
		for (int i = 0; i < WebCamTexture.devices.Length; i++) {  
			
			print (WebCamTexture.devices [i].name);

			if (WebCamTexture.devices [i].name == "Creative GestureCam") {  
				webcamTexture.deviceName = WebCamTexture.devices [i].name;  

				break;  
			}  
		}  

		Renderer renderer = GetComponent<Renderer>();  
		renderer.material.mainTexture = webcamTexture;  
		webcamTexture.Play();  
	}  

}  


unity 打开摄像头(图像倒立的变换) 和显示所有摄像头的名称_unity_02

把相机移到平面的另一侧,同时平面绕x轴旋转90

unity 打开摄像头(图像倒立的变换) 和显示所有摄像头的名称_i++_03unity 打开摄像头(图像倒立的变换) 和显示所有摄像头的名称_unity_04

unity 打开摄像头(图像倒立的变换) 和显示所有摄像头的名称_i++_05

2, Unity3d,调用摄像头显示

3, 图像水平变换

MirrorFlipCamera.cs 脚本放在相机上,这样是整个视野的图像都会变化

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MirrorFlipCamera : MonoBehaviour
{
	new Camera camera;
	public bool flipHorizontal;
	void Awake()
	{
		camera = GetComponent<Camera>();
	}
	void OnPreCull()
	{
		camera.ResetWorldToCameraMatrix();
		camera.ResetProjectionMatrix();
		Vector3 scale = new Vector3(flipHorizontal ? -1 : 1, 1, 1);
		//Vector3 scale = new Vector3(1,flipHorizontal ? -1 : 1,  1);
		//Vector3 scale = new Vector3(1,1 , flipHorizontal ? -1 : 1);
		camera.projectionMatrix = camera.projectionMatrix * Matrix4x4.Scale(scale);
	}
	void OnPreRender()
	{
		GL.invertCulling = flipHorizontal;
	}


	void OnPostRender()
	{
		GL.invertCulling = false;
	}
}
unity 打开摄像头(图像倒立的变换) 和显示所有摄像头的名称_i++_06
内容来源于网络如有侵权请私信删除

推荐文章