W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2012

Re: Matrix4x4 proposal

From: Kristian Sons <kristian.sons@dfki.de>
Date: Mon, 30 Jan 2012 13:46:43 +0100
Message-ID: <4F269133.90802@dfki.de>
To: "Gregg Tavares (勤)" <gman@google.com>
CC: Dean Jackson <dino@apple.com>, public-fx@w3.org
Am 30.01.2012 00:58, schrieb Gregg Tavares (勤):
>
>
> On Mon, Jan 23, 2012 at 5:48 PM, Dean Jackson <dino@apple.com 
> <mailto:dino@apple.com>> wrote:
>
>
>     On 24/01/2012, at 12:46 PM, Gregg Tavares (勤) wrote:
>
>>
>>
>>     On Mon, Jan 23, 2012 at 3:57 PM, Dean Jackson <dino@apple.com
>>     <mailto:dino@apple.com>> wrote:
>>
>>
>>         On 20/01/2012, at 11:03 PM, Kristian Sons wrote:
>>
>>         > Hi,
>>         >
>>         >> // The value of angle is in radians.
>>         >>     void rotateAxisAngle(in double x,
>>         >>                          in double y,
>>         >>                          in double z,
>>         >>                          in double angle);
>>         >
>>         > I didn't follow the discussion from the beginning, so this
>>         might be already discussed:
>>         > In the CSSMatrix proposal, all angles are in degrees. Also
>>         SVG uses degrees in interfaces. Do you want to change to radians?
>>
>>         We agreed to stick with degrees. I need to post an updated
>>         proposal.
>>
>>
>>     Really? Are angles expected to be in degrees by devs who will
>>     actually use these classes?
>
>     This is why I originally proposed radians. I don't feel strongly
>     either way.
>
>
> I don't know what everything else uses but I will point out
>
> Canvas uses radians
> CSS can use degrees or radians or gradians or turns
> CSSMatrix sadly uses degrees (though it's still a draft.)
SVG uses degrees.
>
> While I get that designers will want degrees they seem covered by CSS. 
> On the other hand it seems arguable that anyone who gets to the level 
> of using matrices directly will want radians since most math requires 
> and or returns radians. dot, acos, asin, atan, sin, cos, etc, 
> etc,etc...  Anyone working with CSS-Shaders will also likely end up 
> needing radians.

I don't feel strongly either way, too. It's probably too late to find 
something consistent over all the specs :|

Performance is probably not the reason for one or the other. The 
multiplication with a constant shouldn't be to much overhead and 
creating a rotation matrix from an axis/angle representation is probably 
not in the inner loop.

Perhaps using radians in combination with something like 
rotateAxixAngleRadians. The authors don't have to search in the spec to 
find the used angle representation.

Best,
   Kristian

>
>
>
>
>
>
>     Dean
>
>>     I ask because it seems silly to take the dot product of 2 vectors
>>     and have to convert to degress before I can use the answer. I'm
>>     sure people better at math can name a bunch of other cases.  How
>>     about 2 functions, rotateAxisAngleDegress and
>>     rotateAxixAngleRadians. I suppose with either one you can write a
>>     quick wrapper to produce the other, it just seems wrong to pick
>>     the less efficient one when the whole point of this API is speed
>>     (otherwise just do everything in JS)
>
>
Received on Monday, 30 January 2012 12:47:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 30 January 2012 12:47:17 GMT