Results 1 to 3 of 3

Thread: OpenGL: Calculating Normals...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Question OpenGL: Calculating Normals...

    I'm not expecting many answers on this because everybody here seems to be using DirectX, but anyway...

    In OpenGL, I want to have a function to calculate a face normal from a planar polygon. KnowledgeBase has a function, but it doesn't normalize the final thing, and when I tried to normalize the co-ordinates, it still didn't work.

    I'm very new to OpenGL and this sort of math. But anything to point me in the right direction (normals... vectors... geddit?) would be very nice.

    Thanx,

    me.
    Courgettes.

  2. #2
    Zaei
    Guest
    The normal of a face is the same in DirectX or OGL (or any other 3D application...).

    TO find the normal of a face defined by 3 points, A, B, and C, Subtract A from B and C from B to create two vectors. Take the cross product of those two vectors, and normalize the result. You should be able to find the math for the cross product and normalization on Google.

    Z.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Thanks for that, I haven't tested it yet (sounds like a good thing to do tomorrow morning :P ) but what you said is slightly different from what I'd been doing, so it might work.

    Thanks again,

    me.
    Courgettes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width