|
|
Warp wrote:
>Marcus Fritzsch <m### [at] fritschyde> wrote:
>> i wrote a simple triangulation algo for a noise program to generate
>> something like a hieghtfield, and i wanted to use this with
>> smooth_triangles, does anybody knows how to calculate the normals of the
>> three points from the known triangle?
>
> There are basically two ways:
......
......
> 2. If you don't know the function, or the function is not differentiable
>(or it's just too difficult to do so), then you can use an approximation
>which works quite well for (almost) any mesh: The normal vector at a vertex
>point is the sum of all the normal vectors of the triangles sharing that
>vertex.
> (The normal vector of a triangle can be calculated with the cross-product
>of two of its edges. According to empirical tests, *not* normalizing these
>normals gives the best result in the sum described above (because the
>dot-product of the two edges of a triangle gives a normal vector which
^^^
I guess you meant to write 'cross-product' here ;)
>length is equal to the area of the triangle, and not normalizing this
>vector means that a larger triangle has more effect in the normal of the
>vertex than other smaller triangles sharing that same vertex, which
>reportedly gives better results).)
>...
Tor Olav
Post a reply to this message
|
|