[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    Re: [cairo] Rotation around a point
From:       Dirk_Schönberger <dirk.schoenberger () sz-online ! de>
Date:       2007-11-24 19:07:47
Message-ID: 019101c82ecd$51b2b9e0$14b2a8c0 () rincewind
[Download RAW message or body]

> Hello again,
>  I've been looking around and I can't find much on this. How can I go
about
> setting an x,y within a shape so that it can be rotated (via matrixes)
around
> that point?

> For some background:
> Each of the things I draw gets this before it:
> ThingMatrix = cairo.Matrix ( prop.sx, 0, 0, prop.sy, prop.x, prop.y )
> cairo.Matrix.rotate( ThingMatrix, prop.rot )
> self.context.transform ( ThingMatrix )

I have no idea on the API you use (I assume pycairo), but I would try to do
something like

cairo.Matrix.translate( ThingMatrix, prop.x, prop.y )
cairo.Matrix.scale( ThingMatrix, prop.sx, prop.sy )
cairo.Matrix.rotate( ThingMatrix, prop.rot )

If you add a second

cairo.Matrix.translate( ThingMatrix, x, y ) somewhere, it should be rotated
around this point.
The x and y values may be negated.

Regards
Dirk


_______________________________________________
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic