Sign in to follow this  

Signed angle between two normals?

This topic is 1195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have two polygons which share two vertices, and the normals for both polygons.

 

What I need to determine is whether the shared line between the polygons is a mountain or valley, ie the surfaces point away from each other or towards each other.

 

Finding the angle between the normals is easy:  angle = arccos(dotproduct(N1,N2))

I can't seem to find a simple solution to determine the sign of the angle.

I have tried the atan2 method but this doesn't work, I keep getting an unsigned angle.

There is also a method online (angle between two vectors) that requires the comparison between the cross product of two vectors and the original normal to the plane, but since there isn't a plane, the normal (to the normals) is calculated using the cross product, so only ever compares to itself.

 

I've tried a method of adding the normals to the centers of the polygons and measuring the distances between them, this works most of the time but fails when using acute angles.

 

Is there an equation that will give me the signed angle?

or any other method that can determine if the line is a mountain or valley?

 

Thanks.

 

 

Share this post


Link to post
Share on other sites

If I understand your description, the crossproduct of the normals alone should be sufficient. For a mountain fold, the normals should point away from each other; for a valley fold, the normals should point towards each other. The signs of those crossproducts should be different. Which is which depends on whether your crossproduct function/routine is left-hand or right-hand rule.

 

Since crossproduct = |a| |b| sin( theta ), and, if the normals are normalized (length=1): angle = sin-1( crossproduct ). Test for angle < 0 or > 0. As mentioned, crossproduct functions can be left- and or-handed, so determine which is which.

Share this post


Link to post
Share on other sites
This was discussed not too long ago in this thread.

I don't know what the sign of a cross product means, Buckeye: 3D vectors don't have signs. If you take the result of the cross product and compute its dot product with the common edge, that will give you something whose sign answers the question.

Share this post


Link to post
Share on other sites

 


Buckeye: 3D vectors don't have signs

 

You're absolutely correct. Don't know what I thinking.

 

Thank god, because i was just seriously doubting my understanding of the cross product.

Share this post


Link to post
Share on other sites

 

 


Buckeye: 3D vectors don't have signs

 

You're absolutely correct. Don't know what I thinking.

 

Thank god, because i was just seriously doubting my understanding of the cross product.

 

 

 

laugh.png  Sorry about that. And it was so clear to me when I wrote it!

Share this post


Link to post
Share on other sites

This topic is 1195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this