Ashechol

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: 关于作业2两个三角形重叠部分的Z-Buffer问题 #16111 Score: 0
    Ashechol
    Participant
    1 pt

    果然是框架的问题啊,我就说怎么z在视口变换前大小正常的,视口后就反过来了

    in reply to: 作业1 绕X轴旋转会数组越界 #16105 Score: 1
    Ashechol
    Participant
    1 pt

    目前的解决办法是,讲rasterizer.cpp中set_pixel函数的判断像素是否在画布上的条件从
    if (point.x() < 0 || point.x() >= width || point.y() < 0 || point.y() >= height) return;
    改成
    if (point.x() <= 0 || point.x() >= width || point.y() <= 0 || point.y() >= height) return;

    因为当计算到 (664, 0) 这个像素时,index的生成公式算出的序号会越界,即 490664

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