POV-Ray : Newsgroups : povray.general : traingle vs. smooth triangle Server Time
2 Nov 2024 06:15:38 EDT (-0400)
  traingle vs. smooth triangle (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Mike Weber
Subject: traingle vs. smooth triangle
Date: 15 Feb 2000 10:25:26
Message: <38a96fe6@news.povray.org>
I was just reading about the smooth triangle vs. traingle in the POV docs.
I fully understand the triangle object - but the smooth triangle I don't
because of the normals.  What are normals? How are they used?  I've seen
them used in OpenGL code and don't understand them there either.

mike
www.geocities.com/mikepweber


Post a reply to this message

From: Josh English
Subject: Re: traingle vs. smooth triangle
Date: 15 Feb 2000 10:38:37
Message: <38A97329.736CD514@spiritone.com>
The normal is an imaginary vector at each vertices of the triangle that
declares which way is "up" to that point. By adjusting the "up" vectors at
each point in a mesh of smooth triangles you can create the illusion that the
bump surface of the triangles are joined into one smooth surface, you don't
actually change the surface of the triangle, just it's appearance.
This is similar to a normal statement in a regular POV-Ray texture. It adjusts
the way light interacts with the surface by faking the smoothness of the
circle.
There is a good explanation of it in the ANSI C source code at
http://www.students.tut.fi/~warp/PovUtils/smooth.html
on Warps page. It is very well done and I used this method in my bezier.inc
file.


Mike Weber wrote:

> I was just reading about the smooth triangle vs. traingle in the POV docs.
> I fully understand the triangle object - but the smooth triangle I don't
> because of the normals.  What are normals? How are they used?  I've seen
> them used in OpenGL code and don't understand them there either.
>
> mike
> www.geocities.com/mikepweber

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: Nieminen Juha
Subject: Re: traingle vs. smooth triangle
Date: 16 Feb 2000 05:15:12
Message: <38aa78b0@news.povray.org>
Good explanation. It missed one detail however:

  When you define the normals for each vertex, and you want to calculate
the normal somewhere in the middle of the triangle, it's calculated by
interpolating the three normals of the vertices. (Btw, this is the
so-called phong normal interpolation or phong shading.)

-- 
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: Josh English
Subject: Re: traingle vs. smooth triangle
Date: 17 Feb 2000 11:01:33
Message: <38AC1B98.A90DA153@spiritone.com>
That I did not know... any details on how the exact normal vector is
calculated? My guess would be it's an average of the three normals wighted by
the inverse distance, so the closest normal has the greatest influence....
Josh

Nieminen Juha wrote:

>   Good explanation. It missed one detail however:
>
>   When you define the normals for each vertex, and you want to calculate
> the normal somewhere in the middle of the triangle, it's calculated by
> interpolating the three normals of the vertices. (Btw, this is the
> so-called phong normal interpolation or phong shading.)
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: Nieminen Juha
Subject: Re: traingle vs. smooth triangle
Date: 18 Feb 2000 05:02:01
Message: <38ad1899@news.povray.org>
Yes, the weighted average of the three vertex normals. The weight is the
inverse distance of the point from the vertex (ie. when the point is exactly
at the vertex, the weight for that normal is 1 and for the other two it's 0;
when it's exactly in the middle of the triangle the weight for all normals
will be 1/3).

-- 
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: Matt Giwer
Subject: Re: traingle vs. smooth triangle
Date: 18 Feb 2000 05:15:04
Message: <38AD0D99.7A32D2C8@ij.net>
Josh English wrote:

> The normal is an imaginary vector at each vertice of the triangle that
> declares which way is "up" to that point. By adjusting the "up" vectors at
> each point in a mesh of smooth triangles you can create the illusion that the
> bump surface of the triangles are joined into one smooth surface, you don't
> actually change the surface of the triangle, just it's appearence.

    I haven't looked at the details in nearly two decades but ... is it that one
creates a vector out of the vertex averaging the angle of the two sides and
pointing in the plane. Then two other triangles meet at the same vertex. The three
vectors are averaged and normalized and thus the mesh point angle. And then that
is averaged for midpoints with normal to the center of each triangle.

    And then how many times it is interated is how smooth it is.

    Is that about right?

    The rational rendering routine works backwards from the desired screen
resolution and determines the number of interations required so as to have less
than a pixels difference.

    That is either known or a Master's thesis in it.

    What I have not seen in any writeup is image resolution being a consideration
in rendering.


Post a reply to this message

From: Lance Birch
Subject: Re: traingle vs. smooth triangle
Date: 18 Feb 2000 06:24:08
Message: <38ad2bd8@news.povray.org>
>     I haven't looked at the details in nearly two decades but ... is it
that one
> creates a vector out of the vertex averaging the angle of the two sides
and
> pointing in the plane. Then two other triangles meet at the same vertex.
The three
> vectors are averaged and normalized and thus the mesh point angle. And
then that
> is averaged for midpoints with normal to the center of each triangle.

Half of those sentences didn't seem to make any sense at all to me.  "The
three vectors are averaged and normalized and thus the mesh point angle."
Wha?

>     And then how many times it is interated is how smooth it is.

Why iterate?  It's an interpolating function.

>     The rational rendering routine works backwards from the desired screen
> resolution and determines the number of interations required so as to have
less
> than a pixels difference.

It's resolution independent already.  It's a texture normal perturbation
function, there's no added geometry...

>     What I have not seen in any writeup is image resolution being a
consideration
> in rendering.

Adaptive Degradation.

--
Lance.
The Zone - http://come.to/the.zone


Post a reply to this message

From: Mike Weber
Subject: Re: traingle vs. smooth triangle
Date: 18 Feb 2000 10:43:32
Message: <38ad68a4@news.povray.org>
How about a picture explaining all this???
"Nieminen Juha" <war### [at] sarakerttunencstutfi> wrote in message
news:38ad1899@news.povray.org...
>   Yes, the weighted average of the three vertex normals. The weight is the
> inverse distance of the point from the vertex (ie. when the point is
exactly
> at the vertex, the weight for that normal is 1 and for the other two it's
0;
> when it's exactly in the middle of the triangle the weight for all normals
> will be 1/3).
>
> --
> 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: Josh English
Subject: Re: traingle vs. smooth triangle
Date: 18 Feb 2000 11:05:22
Message: <38AD6E03.69711C87@spiritone.com>
Yer wish is my command. I'll try to have one in p.b.i by this afternoon. I'm
going to be away this weekend at a family reunion... so if I don't make it I'll
get it on Monday

Josh

Mike Weber wrote:

> How about a picture explaining all this???
> "Nieminen Juha" <war### [at] sarakerttunencstutfi> wrote in message
> news:38ad1899@news.povray.org...
> >   Yes, the weighted average of the three vertex normals. The weight is the
> > inverse distance of the point from the vertex (ie. when the point is
> exactly
> > at the vertex, the weight for that normal is 1 and for the other two it's
> 0;
> > when it's exactly in the middle of the triangle the weight for all normals
> > will be 1/3).
> >
> > --
> > main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> > ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: Mike Weber
Subject: Re: traingle vs. smooth triangle
Date: 18 Feb 2000 15:10:15
Message: <38ada727@news.povray.org>
excellent!  Thanks Josh...  Pictures always help me - sometimes more than
words or equations (sp?).

Mike

"Josh English" <eng### [at] spiritonecom> wrote in message
news:38AD6E03.69711C87@spiritone.com...
> Yer wish is my command. I'll try to have one in p.b.i by this afternoon.
I'm
> going to be away this weekend at a family reunion... so if I don't make it
I'll
> get it on Monday
>
> Josh
>
> Mike Weber wrote:
>
> > How about a picture explaining all this???
> > "Nieminen Juha" <war### [at] sarakerttunencstutfi> wrote in message
> > news:38ad1899@news.povray.org...
> > >   Yes, the weighted average of the three vertex normals. The weight is
the
> > > inverse distance of the point from the vertex (ie. when the point is
> > exactly
> > > at the vertex, the weight for that normal is 1 and for the other two
it's
> > 0;
> > > when it's exactly in the middle of the triangle the weight for all
normals
> > > will be 1/3).
> > >
> > > --
> > >
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> > > ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*-
Warp -*/
>
> --
> Josh English
> eng### [at] spiritonecom
> "May your hopes, dreams, and plans not be destroyed by a few zeros."
>
>


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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