交流讨论联系方式:微信:okokokokok112233
camera以左下角为屏幕的(0,0)点坐标,以右上角为屏幕的(camer.pixelWidth,camera.pixelHeight)点坐标,如果用单位化方式显示,则左下角为(0,0)点,右上角为(1,1)点
实例属性
aspect | 设置摄像机视口比例 |
cameratoworldmatrix | 变换矩阵 |
cullingMask | 摄像机按层渲染 |
eventMask | 按层响应事件 |
layerCullDistances | 层消隐距离 |
layerCullSpherical | 圆形的啊 |
orthographic | 正交投影 |
pixelRect | 摄像机渲染区间 |
projectionMatrix | 自定义投影矩阵 |
rect | |
renderingPath | |
targetTexture | |
worldTocameraMatrix |
涉及到的api | |
Matrix4x4 |
标准 4x4 变换矩阵。 |
MultiplyPoint | 按此矩阵变换位置(普通)。 |
Transform.RotateAround | 将变换围绕穿过世界坐标中的 point 的 axis 旋转 angle 度。 |
aspect设置摄像机视口比例
当硬件显示屏的宽高比例与aspect的比例值不同时,视图将发生变形
public class Aspect_ts : MonoBehaviour
{
Camera camera;
private void Start()
{ //camera,aspect的默认值即为当前硬件的aspect值
camera=GetComponent<Camera>();
Debug.Log("camera.aspect的默认