Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 作业1 绕X轴旋转会数组越界 This topic has 2 replies, 2 voices, and was last updated 1 month ago by waqia. Viewing 2 reply threads Author Posts 2023年1月4日 at 下午1:33 #16104 Score: 0 AshecholParticipant 绕y,z轴没有越界的问题 2023年1月4日 at 下午1:58 #16105 Score: 0 AshecholParticipant 目前的解决办法是,讲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 2023年2月26日 at 上午11:55 #16209 Score: 0 waqiaParticipant Karma: 2 pts 因为作业框架没有考虑到三角形出视锥的情况。以z轴转动是不会出视锥的,其他轴很可能会出视锥,这个时候数组会越界 Author Posts Viewing 2 reply threads You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In