Mam trudności z obracaniem kamery internetowej w moim urządzeniu z systemem Android.webcamRozmiar tekstu różni się w unity3d pod Androidem
Oto moja scena w edytorze:
i tutaj jest obraz w moim telefonie:
można zobaczyć różnicę w rotacji i skalowania między telefonem a edytora.
Oto kod:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class Camera_pnl : MonoBehaviour {
//// Use this for initialization
WebCamTexture webCameraTexture;
void Start() {
GUITexture BackgroundTexture = gameObject.AddComponent<GUITexture>();
BackgroundTexture.pixelInset = new Rect(0,0,Screen.width,Screen.height);
WebCamDevice[] devices = WebCamTexture.devices;
foreach (WebCamDevice cam in devices)
{
if (cam.isFrontFacing)
{
webCameraTexture = new WebCamTexture(cam.name);
webCameraTexture.deviceName = cam.name;
webCameraTexture.Play();
BackgroundTexture.texture = webCameraTexture;
}
}
}
void Update() {
if (Input.GetKey (KeyCode.Escape)) {
Invoke("LoadGame",0.1f);
}
}
void LoadGame()
{
webCameraTexture.Stop();
webCameraTexture = null;
Application.LoadLevelAsync("Game");
}
}
Jak mogę rozwiązać ten problem tak moich wyświetlaczy telefonów prawidłowy obrót webcamtexture?
przeczytać: http://forum.unity3d.com/threads/webcamtexture-rotated-and-flipped-on-iphone-when-applied-to-renderer-material-texture.126702/ –