Re: [css3-transforms] Multiplication order

On Nov 11, 2012, at 11:32 PM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:

> On 11/11/12 9:12 AM, Dirk Schulze wrote:
>> On Nov 11, 2012, at 8:03 AM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
>>> http://lists.w3.org/Archives/Public/www-style/2011May/0633.html and
>> 
>> This is addressed in the specification.
> 
> Which "this"?  You seem to be talking about the second issue raised in 
> the above mail, while Simon's problem is with the first issue.
> 
>> The mathematical description section defines how the transformation function gets "translated" into a 4x4 matrix.
> 
> Yes.  What it doesn't define is how that matrix actually acts on points.
> 
>> Simon correctly pointed to the section "The Transform Rendering Model"[1] that describes how to multiply transformation functions:
>> 
>> ""
>> 	• Start with the identity matrix.
>> 	• Translate by the computed X, Y and Z values of ‘transform-origin’
>> 	• Multiply by each of the transform functions in ‘transform’ property from left to right
>> ""
> 
> Simon's point is that "multiply" can be done in two different ways and 
> the spec does not actually clearly define which way to use.

The specification describes the behavior, it doesn't say how it should be implemented. This is up to the UA which needs to match the behavior. But if it helps to understand the principles, I am happy to adapt the section "Nested Transform"[1] from SVG 1.1 into the "The Transform Function Lists"[2] section for the example in this section.

> 
>> To get the local transformation matrix of the current element you do the following (note local transformation matrices transform the local coordinate space and are not the CTM):
> 
> Ah, yes.  For the transformation on coordinate space, you multiply in 
> the opposite order from the transformation on points.

Oh, this depends from your point of view. If you want to have an absolute point get transformed into the local coordinate space of the element you are right. But even SVG specifies it in the opposite way, looking from the point in the local coordinate space. I can add that to the example of  "The Transform Function Lists"[2] as well.

> 
>> That is what the specification says, no?
> 
> Sort of.  I still think the text in section 6 should be more explicit 
> about the multiplication instead of relying on other parts of the spec 
> to actually explain what it means.

That is what I meant. It actually does. It says you should multiply the transform functions of the transform property from left to right to get the transformation matrix. In the paragraph before (same section) it says " The accumulation of these transforms defines a current transformation matrix (CTM)". Or is it the point that it does not say how to get to the accumulated CTM? This was the intention of the section "The Transform Function Lists".

Please say if the suggestions above would be sufficient enough. If not I would be happy to get more feedback how to change the section. This is actually part of the review request that the editors asked for during the last CSS F2F meeting. I really appreciate for suggestions. 

Greetings,
Dirk

[1] http://www.w3.org/TR/SVG/coords.html#NestedTransformations
[2] http://dev.w3.org/csswg/css3-transforms/#transform-function-lists

Received on Monday, 12 November 2012 16:39:51 UTC