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

Re: quick comments on Matrix

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 16 Mar 2013 08:54:47 -0700
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <33B4F254-3C13-4770-8FAF-CCD2D0328A75@adobe.com>

On Mar 15, 2013, at 7:46 PM, Robert O'Callahan <robert@ocallahan.org> wrote:

> On Sat, Mar 16, 2013 at 12:36 AM, Dirk Schulze <dschulze@adobe.com> wrote:
> I guess what you suggest is that (x,y)^T = (0,1)^T is a rotation by 90 degree and (1,0)^T is a rotation by 0 degree? (Note that the rotation is clockwise on SVG.) Maybe it is better to just specify the angle between (1,0)^T and the vector given by x and y. The only special case would be that both values are 0 (which could be defined to be a multiplication by the identity transform == no affect).
> 
> Sure.
> 
> There were similar discussions on webkit-dev mailing list[1].
> 
> That discussion has people arguing for floats but no-one defending doubles...
>  
> Usually 32bit maps better to the underlaying GPU. The difference is less important on desktop CPUs. With standards like OpenCL 1.1 full and others, GPUs are required to get better on double precision anyway. The decision seems to be more if we want to optimize for current hardware or look at the life time of the spec and assume that HW gets better. Changing the spec later causes incompatibility later (even if the difference is very small).
> WebIDL does not support optional datatypes it seems. That means I needed to choose between 64-bit and 32-bit. Upon on requests here on this list, it seems that there are use cases for double precision beyond graphics for the screen.
> 
> What are they?

[1] is one example. I tried to address concerns like this. I can absolutely understand your concerns about performance. I do not have a strong opinion about that. But it does mean that passed translation/scale/skew/rotation values result in a transformation matrix with less precision:

	var a = 1/3;
	var m = new Matrix();
	m.translateBy(a, 0);

Then a is not equal to m.m11, or am I wrong? 

If other browser vendors agree on single precision, I can change it to float. Note that we have a paragraph in SVG about floating point precision [1].

""
It is recommended that higher precision floating point storage and computation be performed on operations such as coordinate system transformations to provide the best possible precision and to prevent round-off errors.
""

This could be considered for Transformation Matrix as well.

Greetings,
Dirk

[1] https://svgwg.org/svg2-draft/single-page.html#types-Precision
[2] http://lists.w3.org/Archives/Public/www-style/2013Feb/0373.html

> 
> Rob
> -- 
> Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir — whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]
Received on Saturday, 16 March 2013 15:55:16 GMT

This archive was generated by hypermail 2.3.1 : Saturday, 16 March 2013 15:55:16 GMT