从投影矩阵获取焦距和焦点 [英] Getting focal length and focal point from a projection matrix

查看:215
本文介绍了从投影矩阵获取焦距和焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个4x4的投影矩阵

I have a 4x4 projection matrix

(SCNMatrix4) 
   s = (m11 = 1.83226573, 
   m12 = 0, 
   m13 = 0, 
   m14 = 0,
   m21 = 0,
   m22 = 2.44078445,
   m23 = 0,
   m24 = 0,
   m31 = -0.00576340035, 
   m32 = -0.0016724075, 
   m33 = -1.00019991, 
   m34 = -1, 
   m41 = 0, 
   m42 = 0, 
   m43 = -0.20002, 
   m44 = 0)

我想从矩阵中得出焦点和焦距.

I would like to get the focal point and the focal length out of this matrix.

推荐答案

摘录自此GDC演示文稿:

焦距仅仅是矩阵(m11)中的第一个元素.

The focal length is merely the first element in the matrix (m11).

焦点,但是不能单独从此矩阵中提取-您需要相机的方向 D position .有了它们后,只需执行P + D * m11即可获得焦点.

The focal point, however, cannot be extracted from this matrix alone - you need the camera direction D and position P. Once you have them, simply do P + D * m11 to obtain the focal point.

这篇关于从投影矩阵获取焦距和焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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