Ho difficoltà a ruotare la webcamtexture nel mio dispositivo Android.webcamTotazione di rotazione diversa in unity3d in Android
Qui è la mia scena l'editor:
e qui è l'immagine nel mio telefono:
Si può vedere la differenza in rotazione e il ridimensionamento tra il telefono e l'editor.
Ecco il codice:
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");
}
}
Come posso risolvere questo problema in modo mio telefono visualizza la corretta rotazione della webcamtexture?
leggere questo: http://forum.unity3d.com/threads/webcamtexture-rotated-and-flipped-on-iphone-when-applied-to-renderer-material-texture.126702/ –