POV-Ray : Newsgroups : povray.newusers : normal_vectors Server Time
24 Dec 2024 13:31:16 EST (-0500)
  normal_vectors (Message 1 to 3 of 3)  
From: Martijn van den Branden
Subject: normal_vectors
Date: 29 Dec 2002 05:56:05
Message: <3e0ed4c5$1@news.povray.org>
Hi there,

i'm a complete newbie to povray, hence this
question: i don't understand the 'smooth' mesh2
example in the pov-doc (included below).
It says in order to create a 'smooth' mesh,
you have to include vertex normals. i can only
think of 1 normal, that is the one perpendicular
to the whole plane (made up by the triangles).
What do these vertex normals do? when
i render the scene below with some light_source
, i get a plane 'warped' on the top side, which
i think is my videocard (tnt-1) going bezerk.

thanks in advance,

Martijn

________________________________________
mesh2 {
   vertex_vectors {
      9,
      <0,0,0>, <0.5,0,0>, <0.5,0.5,0>,
      <1,0,0>, <1,0.5,0>, <1,1,0>,
      <0.5,1,0>, <0,1,0>, <0,0.5,0>
   }
   normal_vectors {
      9,
     <-1,-1,0>,<0,-1,0>, <0,0,1>,
      /*as 1*/ <1,-1,0>, /*as 2*/
      /*as 3*/ <1,0,0>,  /*as 2*/
      /*as 4*/ <1,1,0>,  /*as 2*/
      /*as 5*/ <0,1,0>,  /*as 2*/
      /*as 6*/ <-1,1,0>, /*as 2*/
      /*as 7*/ <-1,0,0>, /*as 2*/
      /*as 8*/ /*as 0*/  /*as 2*/
   }
   face_indices {
      8,
      <0,1,2>, <1,3,2>,
      <3,4,2>, <4,5,2>,
      <5,6,2>, <6,7,2>,
      <7,8,2>, <8,0,2>
   }
   pigment {rgb 1}
}


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: normal_vectors
Date: 29 Dec 2002 06:46:24
Message: <3e0ee090@news.povray.org>
In article <3e0ed4c5$1@news.povray.org> , "Martijn van den Branden" 
<m.v### [at] studenttudelftnl> wrote:

> i'm a complete newbie to povray, hence this
> question: i don't understand the 'smooth' mesh2
> example in the pov-doc (included below).
> It says in order to create a 'smooth' mesh,
> you have to include vertex normals. i can only
> think of 1 normal, that is the one perpendicular
> to the whole plane (made up by the triangles).
> What do these vertex normals do? when
> i render the scene below with some light_source
> , i get a plane 'warped' on the top side, which

Well, as the name says, each vertex (corner) of a triangles gets its own
normal that are then interpolated over the whole triangle surface.  This
gives the impression of a smooth surface as for example the reflection
behaves as if the surface was smooth.

> i think is my videocard (tnt-1) going bezerk.

I think you misunderstand how ray-tracing works.  Also not relevant to this
question, you may want to read
<http://www.povray.org/documentation/view/328/>.

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Jaap Frank
Subject: Re: normal_vectors
Date: 30 Dec 2002 20:32:27
Message: <3e10f3ab$1@news.povray.org>
"Martijn van den Branden" <m.v### [at] studenttudelftnl> wrote in message
news:3e0ed4c5$1@news.povray.org...
Sent: Sunday 29 December 2002 11:49 AM
Subject: normal_vectors

Hi Martijn,

although I'm Dutch too, I will answer in English,
so everybody can follow it.

> Hi there,
>
> i'm a complete newbie to povray, hence this
> question: i don't understand the 'smooth' mesh2
> example in the pov-doc (included below).
> It says in order to create a 'smooth' mesh,
> you have to include vertex normals. i can only
> think of 1 normal, that is the one perpendicular
> to the whole plane (made up by the triangles).
> What do these vertex normals do?

As Thorsten explained, the normals at the vertices
(corners) are not perpendicular to the triangle plane.
They are perpendicular to an imaginary plane that
goes through the vertices. For reflections these normals
are interpolated for every point of the triangle. This
depends of the distances from all three vertices.
This way it gives the impression that the triangle is not
flat, but that it has a rounded surface. You can see this
in the mesh2 example. Two are without these normals and
two are with these normals. The ones without give a
flat impression and the ones with the normals a rounded
impression.
See also in the manual:
    6.5.2.6  Triangle and Smooth Triangle

>                                                                when
> i render the scene below with some light_source
> , i get a plane 'warped' on the top side, which
> i think is my videocard (tnt-1) going bezerk.
>

I don't understand what you mean with 'warped'.
I think not that this is a failure of your videocard,
but that something is wrong with the mesh2 or you
are looking at it at a strange angle.

________________________________________
> mesh2 {
>    vertex_vectors {
>       9,
>       <0,0,0>, <0.5,0,0>, <0.5,0.5,0>,
>       <1,0,0>, <1,0.5,0>, <1,1,0>,
>       <0.5,1,0>, <0,1,0>, <0,0.5,0>
>    }
>    normal_vectors {
>       9,
>      <-1,-1,0>,<0,-1,0>, <0,0,1>,
>       /*as 1*/ <1,-1,0>, /*as 2*/
>       /*as 3*/ <1,0,0>,  /*as 2*/
>       /*as 4*/ <1,1,0>,  /*as 2*/
>       /*as 5*/ <0,1,0>,  /*as 2*/
>       /*as 6*/ <-1,1,0>, /*as 2*/
>       /*as 7*/ <-1,0,0>, /*as 2*/
>       /*as 8*/ /*as 0*/  /*as 2*/
>    }
>    face_indices {
>       8,
>       <0,1,2>, <1,3,2>,
>       <3,4,2>, <4,5,2>,
>       <5,6,2>, <6,7,2>,
>       <7,8,2>, <8,0,2>
>    }
>    pigment {rgb 1}
> }
>

If you give an example, then give a working file, so
that one can paste it inside POV-Ray and test it.
It is not clear what you mean with
            /*as 1*/
because it is not clear where you are referring to.

Success with mastering this wonderful program,

Jaap Frank


Post a reply to this message

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