|
|
On Tue, 16 Mar 1999 13:25:07 +0100, gemelli david
<gem### [at] imerirassofr> wrote:
>I posted an image in povray.binaries.images of an height-field I did
>with a POV file. I use
>a mesh of triangles and I would like to change them to smooth-triangles.
>How can I find normal
>vectors from the corners of the triangles ?
>Thanks !
Consider a typical corner to be set up thus:
B--------------C
/ \ / \
/ \ / \
/ \ / \
/ \ / \
D-------------A-------------E
\ / \ /
\ / \ /
\ / \ /
\ / \ /
F-------------G
Get the normal at A thus:
vnormalize(vcross(B - A, C - A) + vcross(C - A, E - A) + vcross(E - A,
G - A) + vcross(G - A, F - A) + vcross(F - A, D - A) + vcross(D - A, B
- A)).
Make sure that you always go around the point in the same direction
(i.e. clockwise) and remember to allow for points at edges and so on
that do not have six surrounding triangles.
Jerry Anning
clem "at" dhol "dot" com
Post a reply to this message
|
|