小编Cyb*_*jaz的帖子

为什么 z 坐标没有被 glm::ortho() 投影归一化?

我试图更好地理解 glm::ortho 的工作原理,源代码 (v 0.9.7) 如下所示:

template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
(
    T left,
    T right,
    T bottom,
    T top,
    T zNear,
    T zFar
)
{
    tmat4x4<T, defaultp> Result(1);
    Result[0][0] = static_cast<T>(2) / (right - left);
    Result[1][1] = static_cast<T>(2) / (top - bottom);
    Result[2][2] = - static_cast<T>(2) / (zFar - zNear);
    Result[3][0] = - (right + left) / (right - left);
    Result[3][1] = - (top + bottom) / (top - bottom);
    Result[3][2] = - (zFar + zNear) / …
Run Code Online (Sandbox Code Playgroud)

c++ opengl glm-math

1
推荐指数
1
解决办法
763
查看次数

标签 统计

c++ ×1

glm-math ×1

opengl ×1