Unity 3D 画出透视相机的视景体
2016-01-20 10:23
519 查看
void OnDrawGizmos() { Gizmos.color = Color.green; if (theCamera == null) theCamera = GetComponent<Camera>(); Gizmos.matrix = Matrix4x4.TRS(theCamera.transform.position, theCamera.transform.rotation, Vector3.one); Gizmos.DrawFrustum(Vector3.zero, theCamera.fieldOfView, theCamera.farClipPlane, theCamera.nearClipPlane, theCamera.aspect); }
以上代码为编辑器中画出透视相机的视景体,方便调试。
相关文章推荐
- 社区发现(Community Detection)算法 [转]
- unity android 交互的问题
- unity学习(二)
- Unity3D屏幕特效合成
- 2016-1-19-Unity学习日程-跳跃跑酷
- Unity3d 着色器语法(Shader)
- 初学unity(简单场景制作)
- 编写Unity3D着色器的三种方式
- 关于Unity中的_MainTex_ST的一些疑惑
- 初学unity3D—20160119
- UNITY学习的第二天总结
- 【Unity3D自学记录】鼠标移动三维物体
- unity基础开发 1. 射线&碰撞器的原理和用法
- 使用MonoDevelop调试Unity3D的正确步骤
- Unity炮弹拖尾和弓箭的抛物运动方法
- Unity3D的四种坐标系
- Unity 3D中的 SetActive() 与 OnEnable()、OnDisable()要注意的
- unity中刷路点
- 【小松教你手游开发】【unity实用技能】Unity3D_NGUI_性能优化实践_CPU卡顿
- 如何让Maya中的相机和Unity相机的FOV(Angle of View)对上