计算具有 4 个顶点的面法线
我似乎无法找到计算 3D 4 顶点平面法线的方程是什么。给定 4 个顶点(x1,y1,z1),(x2,y2,z2)等。如何计算它们创建的表面的法线?我了解它如何与三角形函数配合使用,但我不确定如何使其适应 4 个顶点
I can't seem to find what the equation is for calculating the normal of a 4 vertex plane in 3D. Given 4 vertices, (x1, y1, z1), (x2, y2, z2), etc. How do I calculate the normal of the surface they create? I understand how it would work with a triangle shaped function, but I don't know for sure how to adapt it to 4 vertices
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将四边形分成两个三角形(无论哪种方式),计算两个法线并对它们求平均值。理想情况下,无论如何,两个法线都是相同的,而在其他情况下,您将获得最佳的近似值。
原因是三角形必然是平面的(没有其他可能),但对于四边形则没有这样的保证。因此,您根本不可能知道单一法线的存在。
平均两个子三角形的法线并不理想,但是对于中间有“折叠”的图元,您还能做什么。
You will need to split the quad into two triangles (does not matter which way), calculate two normals and average them. Ideally, both normals are the same anyway, and in the other case you have a best possible approximation.
The reason is that a triangle is necessarily planar (there is no other way it could be), but for a quad you have no such guarantee. Therefore, you cannot possibly know that a single normal exists at all.
Averaging the normals of two sub-triangles is not ideal, but what else can you do on a primitive that has a "fold" in the middle.