qh

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: 作业三中phong_fragment_shader计算光源方向问题 #9299 Score: 0
    qh
    Participant
    -1 pt

    phong_fragment_shader 里面的 Eigen::Vector3f point = payload.view_pos 是做 MVP 变换之前的坐标,VDirection 算的是做变换前的观察方向,VDirection = eye_pos – point。

    具体你可以跟踪代码看下这个值的来源,phong_fragment_shader 的 payload.view_pos 是根据 rasterize_triangle 的参数 view_pos 插值得到的,在 draw(std::vector<Triangle *> &TriangleList) 函数里传给 rasterize_triangle 的 view_pos 是未进行变换的坐标。

    in reply to: 作业1三角形无法实现远小近大的效果 #9298 Score: -1
    qh
    Participant
    -1 pt

    最后的 projection = s * m * p2o 。

    This post has received 1 vote down.
Viewing 2 posts - 1 through 2 (of 2 total)