透视投影矩阵的通用公式 [英] General Formula for Perspective Projection Matrix

查看:215
本文介绍了透视投影矩阵的通用公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我实现透视投影矩阵"的通用公式是什么?我正在尝试实现一种生成该矩阵的方法,以便将其用于我正在开发的游戏引擎.

Can anyone please tell me what is the general formula to implement the Perspective Projection Matrix? I'm trying to implement a way to generate this matrix in order to use it for a game engine I'm working on.

推荐答案

好吧,基本上,在@spektre和我的一个朋友的帮助下,我能够弄清楚如何真正做到这一点.我使用的公式几乎是这样:

Ok so basically with some help from @spektre and a friend of mine I was able to figure out how to really do this. Pretty much the formula I used was this:

制作该矩阵所需的几乎是一个函数,该函数接收以下4个参数:

So pretty much what you need to make this matrix is a function that receives 4 arguments which are the following:

  • zFar
  • zNear
  • 纵横比
  • 视场

如果您想进一步了解这些字段和矩阵本身,我的建议是转到才能真正看到此效果.

If you want to know more about these fields and the matrix itself my advice is to head over to WebGL 3D Perspective to actually see this working.

这篇关于透视投影矩阵的通用公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆