Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 关于Texture::getColor函数的实现请助教看一下 This topic has 1 reply, 2 voices, and was last updated 4 years, 7 months ago by fuzhanzhan. Viewing 1 reply thread Author Posts 2020年3月15日 at 下午1:09 #4134 Score: 4 小桥流水Participant Karma: 4 pts 在Texture.hpp中,Texture类维护了一个二维数组存储图片的颜色值。 在 getColor 方法中,auto u_img = u * width; 这一句是否应该改成 auto u_img = u * (width -1);? 因为Texture类的成员image_data的索引范围应该是[0, width-1]x[0,height-1],当u=1时,u_img = width,会导致索引越界。v_img的情况类似。 This post has received 4 votes up. 2020年4月10日 at 下午8:18 #5333 Score: 0 fuzhanzhanParticipant 因为uv的值一般是取不到1的,可以看obj文件里的uv数值,个人想法。 Author Posts Viewing 1 reply thread You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In