Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 作业三看见奶牛的背面 This topic has 5 replies, 2 voices, and was last updated 4 years, 7 months ago by water. Viewing 3 reply threads Author Posts 2020年4月6日 at 下午3:54 #5217 Score: 0 waterParticipant Karma: 2 pts 投影的代码拷到PA3,就只能看到奶牛的背面,去掉负号,改成 p2o(2, 3) = n * f; 就成正面了,想不通 This post has received 1 vote up and 1 vote down. Attachments:You must be logged in to view attached files. 2020年4月6日 at 下午5:53 #5222 Score: 1 waterParticipant Karma: 2 pts 我代码贴错了,应是下面这个,不过效果都一样。 我做的时候始终按照课件的,朝向-z轴,公式也是代入。 想不通为什么会多一个z轴的对称变换,哭死 This post has received 1 vote up and 1 vote down. Attachments:You must be logged in to view attached files. 2020年4月6日 at 下午6:55 #5226 Score: -1 刘道明Participant 缩放应该是2/(f-n) This post has received 1 vote down. 2020年4月6日 at 下午7:10 #5227 Score: -1 waterParticipant Karma: 2 pts 感谢回应,但我理解这里的z轴的缩放系数应该是个正数的,而n > f的。应该不是这个问题吧 This post has received 1 vote down. 2020年4月6日 at 下午7:20 #5230 Score: 1 刘道明Participant [n,f]->[-1,1],坐标系问题 This post has received 1 vote up. 2020年4月6日 at 下午8:00 #5235 Score: 2 waterParticipant Karma: 2 pts 好像想明白了,投影变换后,-z的方向看过去,图像其实还是奶牛的正面,但是代码里渲染像素时,x扩展到图像的width,y扩展到图像的height,而且z是vert.z() * f1 + f2,也是正的,差值算出的zp也在这个范围内,所以虽然-z轴看奶牛依然是正面的,但是判断远近是zp,离远点越小越近,所以渲染成了奶牛的背面。 要是渲染像素时,z拓展到负的区间,再对应改z-buf,此时是朝-z轴看了,那应该就是正面了 This post has received 1 vote up. Author Posts Viewing 3 reply threads You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In