Results 1 to 5 of 5

Thread: About Normals...Welding.

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Roma,Italy
    Posts
    4

    About Normals...Welding.

    I don't know wether this post is off-topic or not.I will accept every kind of answer.

    i would like to understand the correct way of calculating Vertex normals. At the moment i'm implementing the classic algorithm wich consist in averaging and normalizing the face normals that share the vertex (Goraud?).

    The resulting object appear nice but with no edges.

    I got some questions about "Averaging":

    - just sum the face-normals?
    - or, sum and divide (for the # of faces)?

    Second Algo: Welding (edge preserving).
    This is what i really like to implement.
    I got some descriptions of the above algo but they are quite obscure.

    Does someone of you have or knows where to pick a clear description of it (pseudo code or some examples).

    I have read a discussion on it made by Nate, and i have the code he use to implement welding, but i like to make a mine implementation.

    Thanks for the patience.

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    28

    Re: About Normals...Welding.

    There is no 'correct' way to produce your normals (unless you have sampled them from a real surface). Usually, the intention is to make the surface appear as smooth as possible. For this, averaging the surrounding polygon normals is usually adequate (as you say - sum them all up and divide by the number of incident polys). Some people also inverse area weight the incident normals. Of course, this will be less efficient.
    To have creases in your object you will need to decide on the maximum angle between incident polys. When you generate your normals you check whether this condition has been violated - and if it has, don't include that poly in the averaging.
    BTW, Goraud shading is the way in which vertex colours are interpolated to determine the colour of each pixel in a triangle. Phong shading is the interpolation of vertex normals to produce the colour of each triangle pixel. You don't need to worry about this - gl does it for you (it uses goraud).

    jimmi

    edit:
    Actually the creases thing is a bit more complex - you will have to store more than one normal for vertices which lie along a crease.


    [This message has been edited by jimmi (edited 04-26-2002).]

  3. #3
    Member Contributor
    Join Date
    Apr 2002
    Location
    Spain
    Posts
    63

    Re: About Normals...Welding.

    Originally posted by kandera:

    I got some questions about "Averaging":

    - just sum the face-normals?
    - or, sum and divide (for the # of faces)?
    You only need to sum the vectors, because you are interested only on the direction of the vector, not its value (after all, after averaging you are normalizing the vector so its length is always 1, don't you?)

    Example: (1,0,0) and (0,1,0)

    You have by adding these two: (1,1,0) Then you normalize it: (1/sqrt(2),1/sqrt(2),0)

  4. #4
    Guest

    Re: About Normals...Welding.

    Nate Robin has some code and a document that
    you might find interesting:
    http://www.xmission.com/~nate/smooth.html

    /peter

  5. #5
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Roma,Italy
    Posts
    4

    Re: About Normals...Welding.

    Thanks to you all!

    I appreciate your answers, they are really useful.

    Now i have to pay more attention to the glm libraries from Nate.Waht i have understood from his page is that if you desire sharp edges you have to sum only vectors which angle (between one and another) respect a threshold (euristically determined, i guess).

    This introduces another doubt: which normal is the referring one?

    mmmmmmh...maybe my question is not clear, let me investigate about it some time...

    yepa!

Similar Threads

  1. Simulation Welding Effect by OpenGL
    By rahnadal in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-25-2012, 12:07 AM
  2. Replies: 6
    Last Post: 04-14-2004, 10:07 PM
  3. face normals or vertex normals
    By infinitecmdz in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 02-21-2004, 07:29 AM
  4. vertex normals or face normals
    By infinitecmdz in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-20-2004, 09:35 AM
  5. is it possible to have vertex normals or even face normals using triangle strips nt
    By wildeyedboyfromfreecloud in forum OpenGL: Advanced Coding
    Replies: 63
    Last Post: 03-19-2002, 11:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean