我推了下根上面不太一样呢
假设n,f 还是课中那样定义,都是负数,那么:
t = -n*tan(theta/2)
r = -aspect*n*tan(theta/2)
b = -t
l = -r
(theta是eye_fov, aspect是aspect_ratio)
那么最终投影矩阵应该是:
(
-1/(aspect*tan(theta/2)), 0, 0, 0,
0, -1/(tan(theta/2), 0, 0,
0, 0, (n+f)/(n-f), 2*n*f/(f-n),
0, 0, 1, 0
)
This post has received 1 vote up.