fluentcg

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: 作业一的投影矩阵推导问题 #16019 Score: 1
    fluentcg
    Participant
    1 pt

    我推了下根上面不太一样呢
    假设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.
    in reply to: 作业1的三角形为什么是朝上的 #16018 Score: 0
    fluentcg
    Participant
    1 pt

    我开始跑出来也是反的,我自己推导了下perspective projection, 在我们定义的右手系下应该前两行带个负号。

    最终的投影矩阵应该是:
    (
    -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
    )

Viewing 2 posts - 1 through 2 (of 2 total)