Change the rotation origin of the group object.

wu
05-28-2004, 01:52 AM
Hello,everybody.
I am from China,and just study SVG .
Today,I want to make a animation that rotate the grounp object with center of it.Now,I face with the big problem that set the rotation origin at center of the group object.The group rotation origin in SVG default station is at upper-left of the current view.

Who can tell me how to set the rotation origin of the group from upper-left to the center of it or the other place?

Follow is my code:

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="7.5cm" height="5cm" viewBox="0 0 200 120">
<g>
<rect x="10" y="10" width="20" height="20" style="fill:yellow;stroke:rgb(0,0,255)"/>
<rect x="50" y="50" width="100" height="60" style="fill:green;stroke:rgb(0,0,255)"/>
<animateTransform attributeName="transform" type="rotate" dur="3s" begin="0s" values="0;-360"/>
</g>
</svg>


best wish!Thanks.

holger
05-28-2004, 05:51 AM
Hi

rotate expects 1 or 3 parameters:
rotate(rotate-angle cx cy)
where cx and cy specify the center of rotation.

check the spec:
http://www.w3.org/TR/SVG11/coords.html#TransformAttribute

hope that helps
p.s.:see my website at http://www.treebuilder.de

Anonymous
05-28-2004, 05:55 AM
oh i forgot.
so your example can look somthing like this:
<animateTransform attributeName="transform" type="rotate" dur="3s" begin="0s" values="0 75 60;-360 75 60"/>

wich will rotate the goup around the point (75,60)

have fun
Holger

wu
06-05-2004, 04:08 AM
With your help, I have already solved the problem, The question is so simple, I am really too stupid.

Resolvent:
<animateTransform attributeName="transform" type="rotate" dur="3s" begin="0s" values="0 50 50;-360"/>


Thank you again.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum