W3C home > Mailing lists > Public > www-svg@w3.org > February 2013

Proposal: transformation matrix interface

From: Dirk Schulze <dschulze@adobe.com>
Date: Thu, 14 Feb 2013 14:29:48 -0800
To: "www-svg@w3.org list" <www-svg@w3.org>, www-style list <www-style@w3.org>, "public-canvas-api@w3.org" <public-canvas-api@w3.org>
Message-ID: <4B37FAD6-F1B5-424F-A006-C12FCC8C5F7F@adobe.com>

The SVG specification[1] has various interfaces for transformations and matrices. One important interface is SVGMatrix which represents a 2D transformation matrix. With the support of CSS3 Transforms[2], the SVGMatrix interface needs to be replaced by a transformation matrix format that allows a 4x4 transformation matrix to represent 3D transformations and perspectives.

The SVG WG believes that it should investigate into an interface 'Matrix' that is not limited to SVG, but can be used together with other specifications as well. Possible specifications that may would benefit of this interface are:
* CSS Transforms (the next level),
* CSSOM[3] to provide access to the matrix data,
* HTML Canvas2d[4] which uses SVGMatrix to describe CTMs at the moment,
* WebGL[5] for representing transformation matrices as well.

The benefit of a common interface is the interoperability between specifications. CSS Transforms can share the transformation data with HTML Canvas or WebGL and vice versa. This allows a new level of interaction between different parts of the web platform. To avoid delays, the interface will be a separate specification with the goal to proceed very fast.

Some details:

* The Matrix interface provides read and write access to each element of the 4x4 transformation matrix: m11-m44
* It is possible to just use a 2D subset of the 4x4 matrix with the elements a-f of a 3x2 matrix. Internally these attributes are just aliases to the corresponding elements on the 4x4 matrix.
* The idea is to specify the most necessary attributes and methods for a first revision and extend the interface in future revisions as needed.
* SVGMatrix must be an subset of Matrix. As such, Matrix supports all methods of SVGMatrix, partly extended for the 3D use cases.
* Rotations are described in degree to be backward compatible to SVGMatrix.

The SVG WG asked me to come up with a proposal and present it to the mailing lists. The drafted proposal is based on an email from Dean Jackson early 2012[6]. I worked together with Dean and the SVG WG to verify the initial proposal.

You can find the drafted proposal on the mercurial directory of the FX TF: https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html

I am happy about editorial feedback. Right now I would like to ask you for an initial, informal review of the proposal. Please send your thoughts and suggestions to the mailing list. If the WGs agree to continue with this proposal, we would need to figure out which WG is involved and who will be the editor of the possible specification.


[1] http://www.w3.org/TR/SVG/coords.html
[2] http://dev.w3.org/csswg/css3-transforms/
[3] http://dev.w3.org/csswg/cssom/
[4] http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/
[5] https://www.khronos.org/registry/webgl/specs/1.0/
[6] http://lists.w3.org/Archives/Public/public-fx/2012JanMar/0007.html
Received on Thursday, 14 February 2013 22:30:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:31 UTC