POV-Ray : Newsgroups : povray.general : Height-field and smooth-triangles Server Time
2 Nov 2024 15:26:17 EDT (-0400)
  Height-field and smooth-triangles (Message 1 to 6 of 6)  
From: gemelli david
Subject: Height-field and smooth-triangles
Date: 16 Mar 1999 07:26:38
Message: <36EE4DA3.FA7B78F7@imerir.asso.fr>
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 !

                    David GEMELLI


Post a reply to this message

From: Rudy Velthuis
Subject: Re: Height-field and smooth-triangles
Date: 16 Mar 1999 08:13:05
Message: <36ee58e1.0@news.povray.org>
gemelli david schrieb in Nachricht <36EE4DA3.FA7B78F7@imerir.asso.fr>...
>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 !


Just an idea (not founded knowledge I mean), but couldn't you add all
direction vectors from a point and then divide them by the number and then
invert it, to make it point outwards. So if your point were V and there were
three vertices to V1, V2, and V3, I would do this:

Norm = - ((V1 - V) + (V2 - V) + (V3 - V)) / 3

or simplified:

Norm = - (V1 + V2 + V3) / 3 - V.

But I'm not sure if this will give you the exact normal, and if the normal
must be normalized too.

--
Rudy Velthuis


Post a reply to this message

From: Jim Kress
Subject: Re: Height-field and smooth-triangles
Date: 16 Mar 1999 11:42:31
Message: <36ee89f7.0@news.povray.org>
I'd suggest you use the cross product of the vectors.  Recently there was a
good posting that should explain how to do this.  Search on cross product.

--
Jim

Check out my web site http://www.kressworks.com/
It'll blow your mind (politically), stimulate your senses (artistically)
and provide scientific insights beyond compare!

Be sure to read the Warp maintained POV VFAQ:
http://iki.fi/warp/povVFAQ.html




gemelli david wrote in message <36EE4DA3.FA7B78F7@imerir.asso.fr>...
>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 !
>
>                    David GEMELLI
>


Post a reply to this message

From: Jerry Anning
Subject: Re: Height-field and smooth-triangles
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

From: Nieminen Mika
Subject: Re: Height-field and smooth-triangles
Date: 16 Mar 1999 13:06:45
Message: <36ee9db5.0@news.povray.org>
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 ?

  You can use my utlility for that:
http://iki.fi/warp/PovUtils/smooth.html

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Gordon
Subject: Re: Height-field and smooth-triangles
Date: 16 Mar 1999 21:51:56
Message: <36ef18cc.0@news.povray.org>
My plugin might also help you out, check in text.scene-files.

Regards
Gordon
<gbe### [at] birdcameroncomau>

Nieminen Mika wrote in message <36ee9db5.0@news.povray.org>...
>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 ?
>
>  You can use my utlility for that:
>http://iki.fi/warp/PovUtils/smooth.html
>
>--
>main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
>):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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