Results 1 to 6 of 6

Thread: "True" normal

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    15

    "True" normal

    Hello ,

    I don't quit understand the "true" normals....

    In my text book(OpenGL Super Bible 2nd Edition) they say that for smooth appearance
    it better calc the average normal for each shared vertex, and use this average value before assign the vertex for render.

    is this mean that :
    when I parse my complex mash object (x-wing fighter) I look for all the triangles where my vertex let say 112 in the array appear (12 times) calc normals for all those triangles and the average will use me when render vertex[112] ????

    Is this "true" normals really needed if my object create from many triangles ???

    Arie
    Arie

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,574

    Re: "True" normal

    That quote is assuming that you want smooth blending across all faces. On something where there are supposed to be hard edges, you should not include those faces in the average of the vertices in question.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    15

    Re: "True" normal

    yes , but what shell I do if mesh made of many triangles (the xwing spaceship) , I really cant tell where is hard edges
    Arie

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    431

    Re: "True" normal

    From a linear algebra book I've got:
    If v and w are nonzero vectors then (v dot w)/(| |v| | | |w| |) = cos theta
    where theta is the angle between the two vectors. Therefore acos of the lhs of that formula gives you the angle between two vectors. In your program, if the angle is greater than some threshold, you have a hard boundary so don't average normals, otherwise, average them. You'll have to determine the threshold through trial and error - whatever looks best for your model.

    <edit>The bottom of that formula doesn't look very good - it's the length of v * the length of w</edit>

    Hope that helps.

    [This message has been edited by ffish (edited 05-11-2001).]

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2001
    Location
    London, UK
    Posts
    14

    Re: "True" normal

    Originally posted by ffish:
    From a linear algebra book I've got:
    If v and w are nonzero vectors then (v dot w)/(| |v| | | |w| |) = cos theta
    where theta is the angle between the two vectors. Therefore acos of the lhs of that formula gives you the angle between two vectors. In your program, if the angle is greater than some threshold, you have a hard boundary so don't average normals, otherwise, average them. You'll have to determine the threshold through trial and error - whatever looks best for your model.

    <edit>The bottom of that formula doesn't look very good - it's the length of v * the length of w</edit>

    Hope that helps.

    [This message has been edited by ffish (edited 05-11-2001).]
    hmm, isn't that supposed to read: "if the angle between the two vectors is *less than* the threshold..." ?

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: "True" normal

    Dario, I think ffish is right: let's say the normal have got the same direction (so you want to smooth between the faces). The angle is 0. Now, let's suppose that the angle between the two normals is 50: say, our threshold for the angle is 30, so you do not want to smooth here.

    ffish is right when he says: "if the angle is greater than some threshold (here 30), you have a hard boundary".

    Of course, when theta increases from 0 to 90, cos theta decreases from 1 to 0. So, if you use cos theta for your test (which is a usual optimisation !), you can say "if the cosine of the anle is lower than some threshold, you have a hard boundary".

    Regards.

    Eric

Similar Threads

  1. True or False?
    By dvwood in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-09-2009, 10:17 AM
  2. TRUE MODE
    By Azazel in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-27-2004, 11:47 PM
  3. True layered fog
    By RCMaster in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-22-2002, 06:23 PM
  4. the TRUE z-value, how can I compute it out?
    By newname in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-21-2001, 10:51 PM
  5. No true darkness?
    By Punchey in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-16-2000, 08:52 AM

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