[Bf-committers] Mesh-Tools in 2.36?
Campbell J Barton
cbarton at metavr.com
Wed Dec 1 01:07:07 CET 2004
Funny- I added that exact function in my teach draw mode, it was used to
draw angles between edges in a face.
Teach draw should make if for 2.37
- Cam
Mal wrote:
> Is there a reason that there isn't a function called
> getAngleBetween2Vectors in the Blender maths library ( as well as
> several other utility functions )?
>
> If they were built in, it would mean that a lot of different coders
> wouldn't have to rewrite relatively simple ( unless you get the
> formulae wrong of course ) functions, and could focus on the real work
> of implementing new features.
>
> Mal
>
>>> How do you find the angle between two vectors? I
>>> found a python function that does this, can you call
>>> python functions from c?
>>>
>>>
>> I believe that that would be the arc cosine of the dot product of the
>> vectors. So, I think that would be:
>>
>> Angle = acos(v1[0] * v[0] + v1[1] * v2[1] + v1[2] + v2[2])
>>
>> . . .where v1 and v2 are vectors. This is of course in radians, so
>> to convert to degrees you would do this:
>>
>> Degree = Angle * 180 / PI (I think).
>>
>> Remember that the dot product of two normalized (where length=1)
>> vectors is equal to the cosine between them.
>>
>> joeedh
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-committers
>>
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
--
Campbell J Barton
133 Hope Street
Geelong West, Victoria 3218 Australia
URL: http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241
More information about the Bf-committers
mailing list