Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业1 绕X轴旋转会数组越界

Viewing 2 reply threads
  • Author
    Posts
    • #16104 Score: 0
      Ashechol
      Participant

      越界
      终止的状态
      绕y,z轴没有越界的问题

    • #16105 Score: 0
      Ashechol
      Participant

      目前的解决办法是,讲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

    • #16209 Score: 0
      waqia
      Participant
      2 pts

      因为作业框架没有考虑到三角形出视锥的情况。以z轴转动是不会出视锥的,其他轴很可能会出视锥,这个时候数组会越界

Viewing 2 reply threads
  • You must be logged in to reply to this topic.