View Single Post
Old 26th May 2014, 02:40 PM   #13
jentron
Senior Member
Professional user
 
Join Date: Nov 2007
Posts: 139
Default Re: Getting the angle vectors ?

Quote:
Originally Posted by fabrizio fracaroli View Post
Hi thanks for quick reply.
Should I post a new thread about it?
In the ac3d, when I select two vertices, I have a measure of distance.
How about to have a feature like this:
When selecting three vertices, the UI shows the angle.
Regards Fabrizio
Hmm, the angle would depend on the order you selected the vertices in.

Math-wise, if your vertices were v1, v2 and v3 you could calculate the angle by letting vectorA = v1-v2 and vectorB = v3-v2 then take:

acos( vectorA dot vectorB )/(||vectorA|| ||vectorB||)

Not sure right now how to wrap that into a neat UI function...

Ron
jentron is offline   Reply With Quote