Calculating normals in height field
Hello,
I have a height-field with non-uniform spacing. I want to compute the normals of the height-field. I used finite differences but want something more accurate. My height y = Sum from 1..n ( a * cos( b ) ) so I think I could differentiate this formula to get find the normals.
y = Sum from 1..n ( a * cos ( b ) ) where a,b are constants
y'' = Sum from 1..n ( -a * sin ( b ) )
What would the normal be? ( dy/dx, ..., dy/dz )?
dy/dx = ( Sum from 1..n ( -a * sin ( b ) ) ) / dx
dy/dz = ( Sum from 1..n ( -a * sin ( b ) ) ) / dz
What should dx and dz be equal to since my height-field has non-uniform spacing?
Thanks in advance!
can t you get the normal of each triangle of a terrain tile (QUAD==2 triangles in this case)
and then average the normals of neightbouring tiles?
(n1+n2+n3+n4)/4
and then average the normals of neightbouring tiles?
(n1+n2+n3+n4)/4
quote:Original post by Basiror
can t you get the normal of each triangle of a terrain tile (QUAD==2 triangles in this case)
and then average the normals of neightbouring tiles?
(n1+n2+n3+n4)/4
where the normals are wighted with the triangles area...
(|N1|*n1+|N2|*n2+|N3|*n3+|N4|*n4)/(|N1|+|N2|+|N3|+|N4|)
where N{1, 2, 3, 4} are the non-normalized normals ( Area = |(oneside x anotherside)| )
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement