firmin
firmin copied to clipboard
3D transforms
Add support for 3D transforms. This should be relatively straightforward for WebKit-based browsers.
Let's look at what support for 3D transforms would entail.
- 3D transform origins
- 3D matrix support
-
translate3d
andtranslateZ
functions -
scale3d
andscaleZ
functions -
rotate3d
androtateX
,rotateY
androtateZ
functions - A
perspective
function - Possibly also support for the
perspective
andperspective-origin
properties
3D matrix support could be added by extending Firmin.CTM
; a 2D CTM is just a specialised version of a 3D CTM. As the spec says,
matrix(
, , , , , ) specifies a 2D transformation in the form of a transformation matrix of six values. matrix(a,b,c,d,e,f) is equivalent to matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, e, f, 0, 1).
The difference would mainly lie in different serialisations, and possibly different code paths for multiplication, if we decided to optimise for speed over code size.
As of version 1.0, the first four of these are supported, so completing Firmin's 3D transform support should just require a nice interface to the various pieces of perspective functionality.