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.
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.