转自:Calculate Normals from Heightmap

 

 

 

From vector calculus, the normal of a surface is given by the gradient operator:

由highmap计算法向量

 

A height map h(x, y) is a special form of the function f:

由highmap计算法向量

 

For a discretized height map, assuming that the grid size is 1, the first-order approximations to the two derivative terms above are given by:

由highmap计算法向量

Since the x step from L to R is 2, and same for y. The above is exactly the formula you had, divided through by 4. When this vector is normalized, the factor of 4 is canceled.

(No linear algebra was harmed in the writing of this answer)

相关文章:

  • 2021-11-04
  • 2021-06-18
  • 2021-10-29
  • 2021-11-01
  • 2022-12-23
  • 2021-11-20
  • 2021-06-27
猜你喜欢
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案