Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 代码中对顶点法线的坐标变换是否错误? Tagged: vertex normal transformation This topic has 3 replies, 4 voices, and was last updated 1 day, 12 hours ago by Adnan Ali. Viewing 3 reply threads Author Posts 2020年3月14日 at 下午2:51 #4041 Score: 0 KeneyrParticipant Karma: 7 pts 在rasterrize.cpp文件中,对顶点法线的变换是这样的,看样子是把model space下的normal变换到view space下的normal。这里是否写错了? 正确的应该是把normal变换到world space吧。。。 Attachments:You must be logged in to view attached files. 2020年3月15日 at 下午8:19 #4181 Score: 0 sQParticipant Karma: 1 pt https://blog.csdn.net/liyaxin2010/article/details/84761280 2020年4月10日 at 下午8:39 #5335 Score: 0 fuzhanzhanParticipant 着色可以在world space 或者 view space 中进行,只要相关的向量都在同一个空间就行,而代码中选择在 view space 中进行,所以都变换到 view space 中了。 2026年9月16日 at 下午6:12 #58881 Score: 0 Adnan AliParticipant 在图形学渲染与着色器开发中,排查顶点法线(Vertex Normal)的坐标变换是否正确,核心在于判断变换矩阵中是否存在非等比缩放(Non-uniform Scaling)。若模型变换仅包含旋转与平移,直接使用常规的模型观察矩阵(Model-View Matrix)变换法线是正确的;但一旦存在非等比缩放,法向量与切线平面的正交性就会被破坏,必须使用法线矩阵——即模型观察矩阵逆矩阵的转置矩阵(Inverse Transpose Matrix)进行变换,并在顶点着色器中重新进行归一化(Normalize)。当你排查完着色器代码、推导完矩阵几何变换并调试好光照渲染 Bug 之后,想找个轻松的平台转换一下心情,不妨访问 https://magius-cas.net/。 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