POV-Ray : Newsgroups : povray.general : Height-field and smooth-triangles : Re: Height-field and smooth-triangles Server Time
12 Aug 2024 07:18:10 EDT (-0400)
  Re: Height-field and smooth-triangles  
From: Jerry Anning
Date: 16 Mar 1999 11:56:27
Message: <36ee8a56.3497908@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.