Jump to content

Angle Measurement


Recommended Posts

I haven't used hou.Vector3.angleTo but is it giving you 90 for both red vectors in the directions as you depicted? If so, maybe try to calculate the angle yourself:

theta = acos (dot (v0, v1))

Thank you for answer but i tried this allready. I get same result. I think it has to do with direction of rotation, but i do not know how to check.

Thank you again!

Link to comment
Share on other sites

I have an idea for this but its a bit stupid because there is an arbitrary element to this. Anyway...somehow decide how you will choose the smaller and the bigger angles depending on those red lines. According to that decision decide whether you do A cross B or B cross A. You will then get a third vector C. Put all of these into a matrix and calculate the determinant. Now with the sign you know whether it is right handed or left handed, and so whether you are dealing with the big angle or the small one.

Something like that.

Link to comment
Share on other sites

Thank you all for replies!!

I did search in the internet and i found only ways to positive and negative angle when i have a third vector, as Edward and eetu said.

I have an idea for this but its a bit stupid because there is an arbitrary element to this. Anyway...somehow decide how you will choose the smaller and the bigger angles depending on those red lines. According to that decision decide whether you do A cross B or B cross A. You will then get a third vector C. Put all of these into a matrix and calculate the determinant. Now with the sign you know whether it is right handed or left handed, and so whether you are dealing with the big angle or the small one.

Macha, i am sorry but i do not understand how i can do this. I found determinant in vops but do not know how to use it. Can you kindly show me example how you would do it?

Thank you!!!

Link to comment
Share on other sites

Hey Erik, unfortunately I haven't been able to post hips for quite a while (hopefully that will change soon) so I will describe it as best I can.

In a vopsop get your 2 vectors. A good way of doing that is via import attribute and setting a constant point as input, so that you don't iterate over all points. The vectors will have to be on 0, so transform that if necessary. Append a vec to float. Then add a matrix3 and set either rows or columns of it as the components of the 3 vectors. So, all of vec1 in row1, vec2 in row2, vec3 in row3. Then append a determinant node and a sign node.

I believe rows/colums doesn't matter and that (hope) the incoming vecs don't have to be orthonormal.

But yeah, I dont know if it is all that useful because by the time you figured out if you cross A by B or B by A you may already have all you need to decide if you deal with the bigger or smaller angle. I'm just think aloud as it were.

Edited by Macha
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...