求助unity大神,摄像机问题画面问题

ck811 2014-06-09 11:14:40
我最近刚学unity游戏开发,然后我需要将unity中摄像机输出的画面整个左右颠倒过来,不知道各位大神有什么方法?
或者可以理解为我想把一个输出的画面变为它自己的镜面效果,就是这个意思,任何方法我都可以接受!
很着急!求各位帮助,感激不尽!!!
...全文
980 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ck811 2014-06-10
  • 打赏
  • 举报
回复
引用 1 楼 candycat1992 的回复:

using UnityEngine;
using System.Collections;

public class MirrorCamera : MonoBehaviour {

	// Use this for initialization
	void Start () {
		MirrorFlipCamera(Camera.main);
	}

	void MirrorFlipCamera(Camera camera) {
		Matrix4x4 mat = camera.projectionMatrix;
		mat *= Matrix4x4.Scale(new Vector3(-1, 1, 1));
		camera.projectionMatrix = mat;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
亲测成功。如果解决了记得结贴哦~
感谢指导!!!问题已经解决!
ck811 2014-06-10
  • 打赏
  • 举报
回复
谢了谢了,我这虽然效果不对,不过你教了我投影矩阵这回事,已经解决,感激不尽!
  • 打赏
  • 举报
回复

using UnityEngine;
using System.Collections;

public class MirrorCamera : MonoBehaviour {

	// Use this for initialization
	void Start () {
		MirrorFlipCamera(Camera.main);
	}

	void MirrorFlipCamera(Camera camera) {
		Matrix4x4 mat = camera.projectionMatrix;
		mat *= Matrix4x4.Scale(new Vector3(-1, 1, 1));
		camera.projectionMatrix = mat;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
亲测成功。如果解决了记得结贴哦~

8,325

社区成员

发帖
与我相关
我的任务
社区描述
游戏开发相关内容讨论专区
社区管理员
  • 游戏开发
  • 呆呆敲代码的小Y
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧