[Bf-python] Good old euler problem

Joseph Gilbert jgilbert at tigr.ORG
Thu Feb 22 19:33:08 CET 2007


Fine. Just make it clear in the api docs that loading degrees into  
anything will return spurius results.

On Thu, 22 Feb 2007 13:13:54 -0500, Martin Poirier <theeth at yahoo.com>  
wrote:

>
> --- Joseph Gilbert <jgilbert at tigr.ORG> wrote:
>
>> Converting Euler to radians so that it is in line
>> with python's math
>> library is a great idea. However, it's internal
>> functions will then expect
>> radians only. Therefore, this just moves the ball
>> instead of fixing the
>> problem.
>>
>> Example:
>> myeuler.Unique()
>>
>> This expect degrees to be loaded into the euler.
>> Load it with radians and
>> it will calculate the wrong answer. Most likely this
>> is also the case with
>> Euler.toMatrix(), Euler.toQuat().
>> The Euler needs to define how it is constructed so
>> we know we are working
>> with radians or degrees.
>>
>> e = Euler(1,2,3)
>> m = Euler.toMatrix()
>>
>> was e in radians or degrees? The calculation of the
>> matrix probably
>> depends on knowing this.
>> I would not like to add a caveat to the Euler module
>> saying "Please use
>> radians or this class will give you bad answers".
>>
>> Splitting out the Euler class into a Radians and
>> Degrees version with a
>> conversion between the two seems like the simplest
>> solution.
>
> No, the simplest solution is defining that all angle
> values returned and accepted by the API must be in
> radians. This is also in line with Python's math
> module and with mathematics in general.
>
> Anything else is just complicating matters for no
> reason (IMHO).
>
> Martin
>
>
> ____________________________________________________________________________________
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the Bf-python mailing list