|
-
Oct 20th, 2001, 03:45 PM
#1
Thread Starter
Fanatic Member
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.
-
Oct 20th, 2001, 05:29 PM
#2
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.
-
Oct 20th, 2001, 05:45 PM
#3
Thread Starter
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|