XML Elves

XML Elves

<community>of XML and SVG Developers</community>


Change the rotation origin of the group object.

This is a discussion on Change the rotation origin of the group object. within the SVG Questions forums, part of the SVG Forums category; Hello,everybody. I am from China,and just study SVG . Today,I want to make a animation that rotate the grounp object ...


Go Back   XML Elves > SVG Forums > SVG Questions

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices


Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-28-2004, 02:52 AM
wu
Guest
 
Posts: n/a
Default Change the rotation origin of the group object.

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:
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-28-2004, 06:51 AM
holger
Guest
 
Posts: n/a
Default rotate(<rotate-angle> [<cx> <cy>])

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

hope that helps
p.s.:see my website at http://www.treebuilder.de
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-28-2004, 06:55 AM
Anonymous
Guest
 
Posts: n/a
Default Change the rotation origin of the group object.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-05-2004, 05:08 AM
wu
Guest
 
Posts: n/a
Default Thanks for Holger.

With your help, I have already solved the problem, The question is so simple, I am really too stupid.

Resolvent:
Code:
<animateTransform attributeName="transform" type="rotate" dur="3s" begin="0s" values="0 50 50;-360"/>
Thank you again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
change, group, object, origin, rotation


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -6. The time now is 12:23 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

Inkjet Printer Inks
Save time and buy all your inkjet printer inks here.

printer ink uk
When buying printer ink in the UK… buy online from us to take advantage of great savings and special offers. We stock loads of brands.

Hard disk drive data recovery yorkshire
Need hard disk drive data recovery in Yorkshire? We collect all over the UK and never exceed our quotation.

ink cartridges Free UK Delivery on ink cartridges such as Canon, Dell, Epson, hp & Lexmark.

1 2 3 4 5 6 7 8 9 10