What is a face normal?

A face normal is a vector that describesthe direction a polygon is facing(see figure 1)

Figure 1: The face normal of a surface

What is a vertex normal?

Vertex normal have some relationships with face normal. We will discuss it in "How to calculate face normal and vertex normal?" Sometimes we can set vertex normal just as same as face normal,  however, using face normals as vertex normals does not produce smooth results when spproximating curved surfaces with triangles.

 

Vertex normal’s function:

Direct3D or Opengl needs to know the vertex normals so that it can determine the angle at which light strikes a surface,and since lighting calculations are done per vertex, Direct3D or Opengl needsto know the surface orientation(normal) per vertex.

How to calculate face normal and vertex normal?

For simple objects such as cubes and spheres, we can see the vertex normals by inspection. For more complex meshes, we need a more mechanical method. Suppose a triangle is formed by the vertices po,p1 and p2, and we need to compute the vertex normal for each of the vertices n0,n1 and n2.

First compute two vectors that lie on the triangle:

p1 - p0 = a

p2 - p0 = b

Then the face normal is :

n = a * b  (* means cross product)

Since each vertex normal is the same as the face normal

n0 = n1 = n2 = n

A better method for finding a vertex normal is normal averaging. To find the vertex normal vn of a vertex v, we find the face normals for all the triangles in the mesh that share vertex v. then vn is given by averaging all of these face normals. Here's an example to illustrate. Suppose three triangles, whose face normals are given by n0,n1 and n2, share the vertex v. Then vn is given by averaging the face normals: vn = (n0 + n1 + n2) /3.

During the transformation stages, it is possible for vertex normals to become non-normal. Therefore, it is best to be safe and renormalize all of your normals after the transformation stages.

Two different type of vertex normal:

Vertex normal can be the same as the face normal (see figure 5)。When we set the vertex normal as the same as the face normal in a .X file, a blue cube will looks like what in below figure, every face has its max brightness when we directly face it.

Figure 5: A vertex has three vertex normals

When we set the vertex normal as the average of the three face normal, when we rotate the cube, the angle will has its max brightness.

Figure 6: A vertex's vertex normal is average of three face normals

http://www.waitingfy.com/?p=425

Face Normals Vertex Normals(面法线跟顶点法线的区别)相关推荐

  1. Unity中计算面法线与顶点法线

    1.什么是法线 法线:是指始终垂直于某平面的直线.在几何学中,法线指平面上垂直于曲线在某点的切线的一条线. 2.面法线与顶点法线 在 Max Wagner 的 <Generating Verte ...

  2. (简洁)面法线与顶点法线

    原文链接:https://blog.kokojia.com/game/b-56.html 每一个面都有自己的法线,在3D游戏中一个三角形代表一个面.法线通常可以用来进行光照计算,用来确定光照的强度如图 ...

  3. unreal 顶点法线与 面法线

    当前revit 建筑模型软件导出的模型对象 three.js的json文件,都是面法线.(暂时是这样的,是否能导出顶点法线,后续确定,7-9 确定js文件可以标记顶点法线和面法线,同时revit可以通 ...

  4. 顶点法线计算的几种方式

    首先,顶点法线都是从面法线加权平均计算得到.所以有两个维度,一是哪些面参与计算,二是权重如何计算. 一 哪些面参与计算 如果建模工具导出了光滑组,那么方案一是直接使用光滑组信息,属于同一个光滑组的面参 ...

  5. Revit的顶点法线及threejs渲染圆弧面的渐变亮度

    本文主要用于分享基于Revit的法线理论,导出模型后让threejs呈现立体真实的效果.Revit的顶点法线及threejs渲染圆弧面的渐变亮度. 法线有什么用的?没有法线能否成模型?可以的,没有法线 ...

  6. MAYAPlugin_Mel_顶点法线批处理_V2

    学习目标: 优化之前的顶点法线批处理插件 学习内容: 1. 删除精简不必要的功能(筛选面,软化面) 2. 算法优化(增加运行效率) 3. 增加代码可读性 学习时间: 2天 学习产出: Adia_ver ...

  7. Python模型顶点法线修复

    Python模型顶点法线修复 参考: https://zhuanlan.zhihu.com/p/52297977

  8. Unity 模型顶点法线不统一————使用Blender修改顶点法线

    遇到的问题:使用Blender创建的模型,顶点法线都是默认的,或者说顶点法线是基于自身三角形(矩形)的.这就导致同一个空间位置上的一个(在图形学引擎中被视为多个)顶点拥有若干个不同的法线向量.当你使用 ...

  9. FX粒子(Niagara系统)、顶点法线材质函数、材质参数集——雪和简单地形材质积雪效果

    雪 一.利用FX--Niagara系统创建粒子,模板选择 喷泉粒子模板      二.删除不需要的模块 球体位置发射.初始的向上速度.拖拽等和雪无关的模块删除. 三.添加需要的模块并设置 需要大范围降 ...

最新文章

  1. 从全球最赚钱的20家公司,我们可以发现什么?
  2. Linux编程 9 (shell类型,shell父子关系,子shell用法)
  3. jsp连接mysql----------第一篇技术类文章
  4. 构建和实现单点登录解决方案
  5. NetworkComms.Net github下载地址
  6. 人工智能数学基础--概率与统计9:概率运算、加法公理、事件的独立性、概率乘法定理、条件概率、全概率公式以及贝叶斯公式
  7. “kuangbin带你飞”专题计划——专题十二:基础DP1
  8. PySpark fold foldByKey用法
  9. python eel vue_张莽子—
  10. IDEA解决crtl+space与搜狗输入法冲突
  11. CentOS 7下的软件安装方法总结
  12. Es refresh index
  13. ingress 七层负载均衡器
  14. 线段树 + 二分答案:Haybale Guessing G
  15. 统计分析中贝叶斯学派介绍
  16. 什么是matlab的幅值域,基于LabVIEW的虚拟频谱分析仪
  17. 以豌豆荚为例,用 Scrapy 爬取分类多级页面
  18. Numpy库的介绍及使用
  19. PKI基础知识(数字信封与数字签名过程,对称密钥与非对称密钥)
  20. 【机器学习】混淆矩阵详细介绍(代码+含义+解释)

热门文章

  1. ATEMTelevisionStudio系列切换台
  2. TCP协议理解和用法以及三次握手四次分手
  3. 华中师范大学微型计算机技术,许静芳-华中师范大学计算机学院
  4. 测试面试 | 一道大厂算法面试真题,你能答上来吗?(附答案)
  5. Introduction-to-Data-Visualization-with-Matplotlib
  6. 准入标准、测试通过标准、上线标准
  7. 面向对象编程(Java)
  8. Struts多附件上传
  9. javascript全文检索工具
  10. uos安装金蝶中间件