dl
函数
dl::Mat 命名空间参考

函数

Matrix4 CreateIdentity ()
 创建平移矩阵 更多...
 
Matrix4 CreateTranslation (const Position3 &t)
 创建平移矩阵 更多...
 
void ApplyTranslation (Matrix4 &m, const Position3 &t)
 平移矩阵 更多...
 
Matrix4 CreateRotation (const Position3 &axis, Float angle)
 创建旋转矩阵 更多...
 
Matrix4 CreateRotation (const Position4 &q)
 创建旋转矩阵(四元数) 更多...
 
Matrix4 CreateScaling (const Position3 &s)
 创建缩放矩阵 更多...
 
Matrix4 CreateLookTo (const Position3 &eye, const Position3 &dir, const Position3 &up)
 创建LookTo矩阵 更多...
 
Matrix4 CreatePerspective (Float fovy, Float aspect, Float z_near, Float z_far)
 创建透视投影矩阵 [0, 1] 更多...
 
Matrix4 CreateOrthogonal (Float left, Float top, Float right, Float bottom, Float z_near, Float z_far)
 创建正交投影矩阵 [0, 1] 更多...
 
Matrix4 GetInverse (const Matrix4 &m)
 获得逆矩阵 更多...
 
void Test ()
 验证正确性 更多...
 

函数说明

◆ ApplyTranslation()

void dl::Mat::ApplyTranslation ( Matrix4 &  m,
const Position3 &  t 
)

平移矩阵

◆ CreateIdentity()

Matrix4 dl::Mat::CreateIdentity ( )
inline

创建平移矩阵

在文件 dl_matrix.h 第 284 行定义.

◆ CreateLookTo()

Matrix4 dl::Mat::CreateLookTo ( const Position3 &  eye,
const Position3 &  dir,
const Position3 &  up 
)

创建LookTo矩阵

◆ CreateOrthogonal()

Matrix4 dl::Mat::CreateOrthogonal ( Float  left,
Float  top,
Float  right,
Float  bottom,
Float  z_near,
Float  z_far 
)

创建正交投影矩阵 [0, 1]

◆ CreatePerspective()

Matrix4 dl::Mat::CreatePerspective ( Float  fovy,
Float  aspect,
Float  z_near,
Float  z_far 
)

创建透视投影矩阵 [0, 1]

◆ CreateRotation() [1/2]

Matrix4 dl::Mat::CreateRotation ( const Position3 &  axis,
Float  angle 
)

创建旋转矩阵

◆ CreateRotation() [2/2]

Matrix4 dl::Mat::CreateRotation ( const Position4 &  q)

创建旋转矩阵(四元数)

◆ CreateScaling()

Matrix4 dl::Mat::CreateScaling ( const Position3 &  s)

创建缩放矩阵

◆ CreateTranslation()

Matrix4 dl::Mat::CreateTranslation ( const Position3 &  t)

创建平移矩阵

◆ GetInverse()

Matrix4 dl::Mat::GetInverse ( const Matrix4 &  m)

获得逆矩阵

注解
常见的方法有 求伴随矩阵、行列式值;还有LU分解法
这里暂时copy一下glm的代码

◆ Test()

void dl::Mat::Test ( )

验证正确性