博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Unity3D动态创建摄像机
阅读量:1985 次
发布时间:2019-04-27

本文共 820 字,大约阅读时间需要 2 分钟。

   摄像机本身的depth越大,则它所渲染的东西越靠顶   

public GameObject CameraObj;public const int CAM_DEPTH = 2;public const int CAM_LAYER = 5;public void CreateCamere(){    CameraObj = new GameObject("myCamera");    Camera cam = CameraObj.AddComponent
(); cam.transform.localPosition = Vector3.zero; cam.transform.localScale = Vector3.one * 0.002777778f; cam.depth = CAM_DEPTH; cam.cullingMask = 1 << CAM_LAYER; cam.gameObject.layer = CAM_LAYER; cam.clearFlags = CameraClearFlags.Depth;     cam.orthographic = true;    //投射方式:orthographic正交// cam.orthographicSize = 1;   //投射区域大小// cam.nearClipPlane = -2.7f;  //前距离// cam.farClipPlane = 2.92f;   //后距离// cam.rect = new Rect(0, 0, 1f, 1f); UICamera uiCam = CameraObj.AddComponent
(); uiCam.eventReceiverMask = 1 << CAM_LAYER;}

 

转载地址:http://mrzvf.baihongyu.com/

你可能感兴趣的文章
COMP7404 Machine Learing——KNN
查看>>
COMP7404 Machine Learing——SVM
查看>>
COMP7404 Machine Learing——Decision Tree & Random Forests
查看>>
COMP7404 Machine Learing——Hyperparameter Grid Search & Nested Cross-Validation
查看>>
COMP7404 Machine Learing——Confusion Matrix & Precision/Recall/F1
查看>>
COMP7404 Machine Learing——ROC
查看>>
Python量子计算qiskit
查看>>
Python的多线程不是真的多线程(GIL全局解释器锁)
查看>>
Python手动读取MNIST数据集
查看>>
Python手动读取CIFAR-10数据集
查看>>
Pytorch(十一) —— 分布式(多GPU)训练
查看>>
Deeplab v3
查看>>
Pytorch之经典神经网络语义分割(3.2) —— ASPP 空洞空间金字塔池化(atrous spatial pyramid pooling )
查看>>
NLP 之 Perplexity困惑度
查看>>
tensor/矩阵/图片等更换通道,调整size
查看>>
本地和colab 中 改变tensorflow的版本
查看>>
Camera-ready ddl
查看>>
CUB-200鸟类数据集
查看>>
Python反射机制
查看>>
YAPF —— Python代码格式化工具
查看>>