Karlmeister

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: 关于作业2和作业3中Z-Buffer的问题 #7255 Score: 0
    Karlmeister
    Participant

    找到问题所在了,rasterize_triangle得到的三角形的顶点vector不是在齐次坐标系的坐标点,只有xyz三个值是除过w的,w保持不变。。。所以bounding box和后面公式里都用的是v的xyzw,且强制auto v = t.toVector4,即v.w恒为1。。。实在不明白为什么要这么写

    Attachments:
    You must be logged in to view attached files.
    in reply to: 关于作业2和作业3中Z-Buffer的问题 #7254 Score: 0
    Karlmeister
    Participant

    我发现代码中如果v改成t.v,就会出问题,而所有v.w都是1…是不是这个t.v的坐标空间本身就有问题,xyz三个分量已经除过一次w,而w还是w没有变?所以我看大家求bounding box的时候也没有把齐次坐标里的w除去的样子。。

    in reply to: 作业2:三角形底边上出现了圆角 #7251 Score: 0
    Karlmeister
    Participant

    不对。。好像点乘可以,但确实应该是判断三角形出了问题

    in reply to: 作业2:三角形底边上出现了圆角 #7250 Score: 0
    Karlmeister
    Participant

    应该是insideTriangle函数写错了,判断三个叉积是不是同方向不能用点乘,而是随便找某一个维上看正负是否相同

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