POV-Ray : Newsgroups : povray.windows : Computing normals for use in smooth_triangle : Re: Computing normals for use in smooth_triangle Server Time
28 Jul 2024 16:20:14 EDT (-0400)
  Re: Computing normals for use in smooth_triangle  
From: Jim Kress
Date: 10 May 1998 11:26:14
Message: <3555C716.A7EEC0C3@dccmail.com>
Thanks again.  After recovering from my initial attack of stupidity, if figured
out what you meant and implemented.  It works GREAT!

Jim

Johannes Hubert wrote:

> Jim Kress wrote in message <35552876.2EC1244E@dccmail.com>...
> >I have an object that isdescribed by a large number of triangles.  I
> >have the x,y,z coordinates for each vertex of every triangle.  Can
> >anyone explain how to calculate the normal vectors for me to use with
> >the smooth_triangle function in POVray?
> >
>
> First, calculate the normal for each triangle. If the triangle has the tree
> vertices v1, v2, v3, it is defined by the following cross-product:
>

>
> Once you have the normal for each triangle, you then calculate the normal of
> each vertex by calculating the average of the triangle-normals of all
> triangles that use this vertex:
> Simply add the normals of all triangles that use a vertex together and
> normalize the resulting vector.
>
> Note: In the cross-product the order of the vertices is important. You
> should choose v1, v2, v3 in clockwise or counter-clockwise fashion for all
> triangles in a mesh. Which one doesn't matter but to mix them can have
> strange results. Why? Because the crossproduct gives you a vector pointing
> in one direction or the same vector pointing in the opposite direction,
> depending on the order of the vertices. And mixing normals that point to the
> "inside" and the "outside" of the mesh when calculating the averaged normal
> often gives strange results.

--






History students know full well that similar opinions have existed
before.  The circumstances paralleled those of today.  For example:

A country enjoying a booming economy was led by someone whose
ethical and legal malfeasance was already well known.  The economic

transgressions, until it was too late. It was all looked at as

else he claimed he was doing for the country.

         It happened in the 1930s.
         In Germany.  Under Adolph Hitler.


Post a reply to this message

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