Matrix4x4 矩阵api介绍

Namespace: UnityEngine

Description 描述

A standard 4×4 transformation matrix.

一个标准的4×4变换矩阵。

A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear etc.) and perspective transformations using homogenous coordinates. You rarely use matrices in scripts; most often using Vector3s, Quaternions and functionality of Transform class is more straightforward. Plain matrices are used in special cases like setting up nonstandard camera projection.

一个变换矩阵可以表达任意的线性3D变换(例如平移,旋转,缩放,切变等)并且使用齐次坐标系进行投影变换。我们基本上不会在脚本中使用矩阵;通常都直接使用三维向量、四元数以及Transform对象的函数。在特殊的场合例如设置一个非标准化的摄像机投影时才使用纯粹的矩阵。

Consult any graphics textbook for in depth explanation of transformation matrices.

参考任意一本图形学对于变换矩阵的深入解释。

In Unity, Matrix4x4 is used by several Transform, Camera, Material and GL functions.

在Unity中,Matrix4x4对象被很多Transform,Camera,Matierial和Gl中的函数使用。

Matrices in unity are column major. Data is accessed as: row + (column*4). Matrices can be indexed like 2D arrays but in an expression like mat[a, b], a refers to the row index, while b refers to the column index (note that this is the opposite way round to Cartesian coordinates).

Unity中的矩阵使用的是列优先。数据通过行+(列*4)的方式获取。矩阵可以被索引为类似二维数组的形式,但是要以mat[a,b]这样的表达式。其中a代表行号,b代表列号(注意这正好与笛卡尔坐标系相反)。

Static Variables 静态变量

identity Returns the identity matrix (Read Only).
返回单位矩阵(只读)。
zero Returns a matrix with all elements set to zero (Read Only).
返回所有元素设置为零的矩阵(只读)。

Variables 变量

determinant The determinant of the matrix.
矩阵的决定因素。
inverse The inverse of this matrix (Read Only).
这个矩阵的逆矩阵(只读)。
isIdentity Is this the identity matrix?
这个矩阵是单位矩阵吗?
this[int,int] Access element at [row, column].
获取[行,列]所对应的元素。
transpose Returns the transpose of this matrix (Read Only).
返回这个矩阵的转置矩阵(只读)。

Functions 方法

GetColumn Get a column of the matrix.
获取这个矩阵的一列。
GetRow Returns a row of the matrix.
返回这个矩阵的一行。
MultiplyPoint Transforms a position by this matrix (generic)
使用该矩阵对一个坐标(点)进行变换(普通)
MultiplyPoint3x4 Transforms a position by this matrix (fast).
使用该矩阵对一个坐标(点)进行变换(快速)
MultiplyVector Transforms a direction by this matrix.
使用该矩阵对一个方向(按方法名理解应该是向量吧,向量包含方向和大小,译者注)进行变换
SetColumn Sets a column of the matrix.
给这个矩阵的一列赋值。
SetRow Sets a row of the matrix.
给这个矩阵的以行赋值。
SetTRS Sets this matrix to a translation, rotation and scaling matrix.
把这个矩阵变为平移、旋转和缩放矩阵。
ToString Returns a nicely formatted string for this matrix.
返回一个该矩阵的漂亮的格式化字符串。

Static Functions 静态方法

Ortho Creates an orthogonal projection matrix.
创建一个正交投影矩阵。
Perspective Creates a perspective projection matrix.
创建一个透视投影矩阵。
Scale Creates a scaling matrix.
创建一个缩放矩阵。
TRS Creates a translation, rotation and scaling matrix.
创建一个平移、旋转和缩放矩阵。

Operators 运算符重载

operator * Multiplies two matrices.
两个矩阵相乘。

转http://wiki.ceeger.com/script/unityengine/classes/matrix4x4/matrix4x4

Matrix4x4矩阵 api的更多相关文章

  1. Unity手游之路<四>3d旋转-四元数,欧拉角和变幻矩阵

    http://blog.csdn.net/janeky/article/details/17272625 今天我们来谈谈关于Unity中的旋转.主要有三种方式.变换矩阵,四元数和欧拉角. 定义 变换矩 ...

  2. Unity3D开发之Matrix4x4矩阵变换

    在Unity开发中时常会用到Matrix4x4矩阵来变换场景中对象的位置.旋转和缩放.但是很多人都不太理解这儿Matrix4x4变换矩阵.通过DX中的变换矩阵我来讲一讲在unity中这个变换矩阵是怎么 ...

  3. ECOS- 技术问题答疑[转]

    http://bbs.ec-os.net/read.php?tid=37 1.为什么我购买的是源码版,但是我的base/ego.php(或者base/ego/目录下文件)却是加密的?  答:ego 源 ...

  4. ecos 问题答疑(转)

    1.为什么我购买的是源码版,但是我的base/ego.php(或者base/ego/目录下文件)却是加密的?  答:ego 源码商业授权文件仅用于和商派软件签订源码协议的商业用户按照甲乙的源码保护约定 ...

  5. 50家硅谷IT公司技术博客

    分享一下 50 家硅谷优秀 IT 公司技术博客,从中可以了解企业文化,技术特色和设计语言,如果直接列出来很单调,加上点评,算吐槽版吧. 知名大厂   1. Facebook https://www.f ...

  6. MultiplyVector方法

    该方法的功能是用来对方向向量v进行矩阵变换,当矩阵与v进行变换时,只是对v的方向进行转换.那么系统就会对参与变换的Matrix4x4矩阵M进行特殊处理. 例如:经过系统处理后就变为 其中n002 + ...

  7. Spark机器学习MLlib系列1(for python)--数据类型,向量,分布式矩阵,API

    Spark机器学习MLlib系列1(for python)--数据类型,向量,分布式矩阵,API 关键词:Local vector,Labeled point,Local matrix,Distrib ...

  8. 介绍Unity中相机的投影矩阵与剪切图像、投影概念

    这篇作为上一篇的补充介绍,主要讲Unity里面的投影矩阵的问题: 上篇的链接写给VR手游开发小白的教程:(三)UnityVR插件CardboardSDKForUnity解析(二) 关于Unity中的C ...

  9. html5 canvas常用api总结(三)--图像变换API

    canvas的图像变换api,可以帮助我们更加方便的绘画出一些酷炫的效果,也可以用来制作动画.接下来将总结一下canvas的变换方法,文末有一个例子来更加深刻的了解和利用这几个api. 1.画布旋转a ...

随机推荐

  1. android开发之自定义圆形ImagView

    在日常使用中我们经常会使用到圆形的图片,但是android系统中并没有默认的圆形控件,所以我们需要自己来写一个自定义的ImagView来显示一张圆形的图片,下面先看效果 详细的方法是我们自定义一个类, ...

  2. 部署步骤“回收 IIS 应用程序池”中出现错误: 无法将通信对象 System.ServiceModel.InstanceContext 用于通信,因为它已经被中止。

    ??? 重启iis应用程序池和网站都不管用,重启vs就好了,一脸懵逼. 有没有更好的方法?

  3. nginx -- 启动, 重启, 关闭

    Nginx的启动.停止与重启 重启:  nginx -s reload 启动 启动代码格式:nginx安装目录地址 -c nginx配置文件地址 例如: [root@LinuxServer sbin] ...

  4. docer中运行crontab

    1  安装 sudo apt-get install cron 2 启动 start cron 3  列出所有本机启动crontab任务 ls -l /etc/init.d 列出所有自建cron任务 ...

  5. 新人补钙系列教程之:XML处理方法

    初始化XML对象XML对象可以代表一个XML元素.属性.注释.处理指令或文本元素.在ActionScript 3.0中我们可以直接将XML数据赋值给变量: var myXML:XML = <or ...

  6. IntelliJ IDEA 取消控制台行数限制

    在idea7之后的版本中取消了 控制台行数设置 选项,只能通过更改配置文件进行更改 在%安装目录%/bin中找到idea.properties文件,更改idea.cycle.buffer.size项值 ...

  7. ECSHOP去版权(删除ECSHOP所有标识)

    前台部分: 1:去掉头部TITLE部分的ECSHOP演示站 Powered by ecshop前者”ECSHOP演示站”在后台商店设置 – 商店标题修改后者” Powered by ecshop”打开 ...

  8. 安装jenkins插件的两种方法

    安装jenkins插件有两种方法,一种是在线安装,一种是离线安装.两种方式介绍如下: 1.如果服务器可以上网,那边选择在线安装最好不过了,安装流程为:系统管理----插件管理---选择需要的插件直接安 ...

  9. poj1236 Network of Schools ,有向图求强连通分量(Tarjan算法),缩点

    题目链接: 点击打开链接 题意: 给定一个有向图,求: 1) 至少要选几个顶点.才干做到从这些顶点出发,能够到达所有顶点 2) 至少要加多少条边.才干使得从不论什么一个顶点出发,都能到达所有顶点   ...

  10. java学习笔记——大数据操作类

    java.math包中提供了两个大数字操作类:BigInteger(大整数操作类) BigDecimal(大小数操作类). 大整数操作类:BigInteger BigInteger类构造方法:publ ...