के तहत unity3d में भिन्न है मुझे अपने एंड्रॉइड डिवाइस में वेबकैमटेक्चर घूर्णन करने में कठिनाई हो रही है।वेबकैमटेक्चर रोटेशन एंड्रॉइड
यहाँ संपादक में मेरी दृश्य है:
और यहाँ मेरे फोन में छवि है:
आप रोटेशन और फोन और संपादक के बीच स्केलिंग में अंतर देख सकते हैं।
यहाँ कोड है:
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");
}
}
कैसे मैं इतना मेरे फोन प्रदर्शित करता है webcamtexture की सही रोटेशन इस समस्या को ठीक कर सकते हैं?
इस पढ़ें: http://forum.unity3d.com/threads/webcamtexture-rotated-and-flipped-on-iphone-when-applied-to-renderer-material-texture.126702/ –