Hi all,
I would like to rotate objects around their center by altering the Inkscape SVG of an image. Since the object have already been translated, I need to merge the rotate with that.
I have posted an example here in September: http://www.inkscapeforum.com/viewtopic.php?f=16&t=12761 but until now, nobody was able to help me.
What do I need to do in order to rotate as described in the example?
Thanks,
Pander
(cx,cy) is the origin of the ellipse. For the rotation to work properly, you first have to translate that out, rotate, then retranslate after the rotation.
So for your objects, say it first has "translate(50,100)", and the ellipse has (cx,cy), and you want a rotation by 45 degrees, then the matrix you're looking for is:
"translate(50,100) translate(cx,cy) rotate(45) translate(-cx,-cy)"
which you can actually simplify with the extended rotate around point: "translate(50,100) rotate(45, cx,cy)"
Gory details here: http://www.w3.org/TR/SVG/coords.html http://www.w3.org/TR/SVG/shapes.html#EllipseElement
-Tom tomlechner.com
On 12/04/2012 01:43 PM, Pander wrote:
Hi all,
I would like to rotate objects around their center by altering the Inkscape SVG of an image. Since the object have already been translated, I need to merge the rotate with that.
I have posted an example here in September: http://www.inkscapeforum.com/viewtopic.php?f=16&t=12761 but until now, nobody was able to help me.
What do I need to do in order to rotate as described in the example?
Thanks,
Pander
participants (2)
-
Pander
-
Tom Lechner