W3C home > Mailing lists > Public > www-svg@w3.org > November 2010

Rotation about centroid and scaling to shrink in place (without scripting)

From: ddailey <ddailey@zoominternet.net>
Date: Sat, 13 Nov 2010 16:05:36 -0500
Message-ID: <CE8F39322DC441799A864D651C539CCB@disxgdg31szkx7>
To: "www-svg" <www-svg@w3.org>
Teaching people to use SVG is a bit different than writing a spec I suppose, 
and perhaps, even a bit different than building a browser. Sometimes,  I 
can't help but think we should take lessons from those who try to learn to 
use our things. It may give insights into designing things. I have a friend 
who used to "fix" the airplane cockpits that were too complicated for humans 
to fly. That was after a few of them crashed.

I think it would be nice to have attribute values for rotations like
transform="rotate(45, 'center' )" and transform="rotate(45, 
'center-of-Mass' )" where center is the center of the getBBox() of the 
object being transformed and center-of-Mass is its 2nd central moment
and for scaling like transform="scale(.5, 'center' )" so that the thing 
shrinks relative to its center rather than to 0,0.

One can use script to do it, but suppose we want to enable people to do it 
without script.

Clearly it is just a convenience to avoid having to get out one's scribble 
pad and draw a picture and do the arithmetic. I find that for very simple 
objects I can sometimes do that math in my head but I find a lot of folks 

For something like
<animateTransform attributeName="transform" type="translate" dur="4s" 
values="0,0;-110,-140;0,0" repeatCount="indefinite"/>
 <animateTransform attributeName="transform" additive="sum" type="scale" 
dur="4s" values="1;1.5;1" repeatCount="indefinite"/>
<animateTransform attributeName="transform" additive="sum" type="rotate" 
dur="7s" values="0,216 242;360 216 242" repeatCount="indefinite"/>
as used in 
almost needs to use getBBox in order to know how to proceed with the rather 
complicated polygon involved.CheersDavid 
Received on Saturday, 13 November 2010 21:06:12 UTC

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