GL
- Begin
- ClearWithSkybox
- Clear
- Color
- End
- InvalidateState
- LINES
- LoadIdentity
- LoadOrtho
- LoadPixelMatrix
- LoadProjectionMatrix
- modelview
- MultiTexCoord2
- MultiTexCoord3
- MultiTexCoord
- MultMatrix
- PopMatrix
- PushMatrix
- QUADS
- SetRevertBackfacing
- TexCoord2
- TexCoord3
- TexCoord
- TRIANGLE_STRIP
- TRIANGLES
- Vertex3
- Vertex
- Viewport
GL.LoadProjectionMatrix 加载投影矩阵
static function LoadProjectionMatrix (mat : Matrix4x4) : void
Description描述
Load an arbitrary matrix to the current projection matrix.
加载一个任意的矩阵到当前的投影矩阵。(矩阵的运算在脚本中很少用到。大部分可以用Transform 类更直接)
This function overrides current camera's projection parameters, so most often you want to save and restore projection matrix using GL.PushMatrix and GL.PopMatrix.
这个函数覆盖当前的 Camera 投影参数,许多情况下你需要用到GL.PushMatrix 和GL.PopMatrix矩阵函数.来保存和恢复。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Matrix4x4 projMtrx = Matrix4x4.identity;
void OnPostRender() {
GL.PushMatrix();
GL.LoadProjectionMatrix(projMtrx);
GL.PopMatrix();
}
}
var projMtrx : Matrix4x4 = Matrix4x4.identity;
function OnPostRender() {
GL.PushMatrix();
GL.LoadProjectionMatrix(projMtrx);
// Do your drawing here...
GL.PopMatrix();
}
最后修改:2011年3月22日 Tuesday 10:18