Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业1中透视投影矩阵是否需要Mviewport矩阵

Viewing 2 reply threads
  • Author
    Posts
    • #3187 Score: -1
      daicver
      Participant

      看了论坛中同学们的提问和老师助教的解答,大致明白了整个流程,viewport*Ortho*Pers->Ortho*ModelView*原始坐标,需要填充透视投影矩阵至少应该包含Ortho*Pers->Ortho这两个矩阵,对于viewport的使用有些疑问。
      根据老师给的默认zNear为0.1,利用ppt5中第6页的公式可得,t=0.041;r=0.041。也就是说,width/2=0.041,height/2=0.041,测此时的viewport矩阵相当于一个缩小尺寸的矩阵,而不是一个扩展尺寸的矩阵。所以感觉应该是上一句话中计算有误,width/2和r,height/2和t指的不是一个概念。在透视投影矩阵中不使用viewport时,三角形显示大小较为正常(因为不知道正确的是什么样子);使用viewport矩阵时,则三角形缩小到接近像素级别的三角形但是可以看清。所以不知道如何继续进行,是舍弃viewport矩阵还是改一个较大的zNear。希望老师同学不吝赐教。

      This post has received 1 vote down.
    • #3188 Score: -1
      Angus
      Participant
      23 pts

      viewport transformation 代码中已经写好了,它不属于透视投影的一部分。

      This post has received 1 vote down.
      • #3193 Score: 1
        daicver
        Participant

        那透视投影矩阵不是传进来了,视角和宽高比,这两个参数有什么用呀?根据这两个参数可以计算出,r,t,l,b等参数,但是透视投影矩阵貌似没有使用这些参数呀?

        This post has received 1 vote up and 1 vote down.
        • This reply was modified 2 years, 7 months ago by daicver.
        • #3206 Score: -1
          Angus
          Participant
          23 pts

          Ortho 参考ppt4 page24
          Pers->Ortho 参考ppt4 page33 & 36

          This post has received 1 vote down.
    • #3205 Score: -1
      Angus
      Participant
      23 pts

      Pers->Ortho 用到了 zNear 和 zFar 这两个参数
      Ortho 用到了t,b,l,r,zNear,zFar全部六个参数

      This post has received 1 vote down.
      • #3207 Score: -1
        daicver
        Participant

        好的,谢谢。

        This post has received 1 vote down.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.