XInput transform matrix

Cedric Sodhi manday at gmx.net
Thu Jun 14 00:46:56 PDT 2012


On Thu, Jun 14, 2012 at 02:43:30PM +1000, Peter Hutterer wrote:
> On Wed, Jun 13, 2012 at 05:46:19PM +0200, Cedric Sodhi wrote:
> > Can anyone tell me which transform matrix (prop 133 in XI) I have to
> 
> fwiw, the numerical value may be different on each machine (even on each
> startup), it purely depends on how many other properties were created before
> this one. only a handful of atoms have real fixed values, they're named
> XA_...  (XA_ATOM, XA_CARDINAL, etc.)
> 
> > choose so that my touchscreen lines up with my 90 ccw rotated display?
> > I've tried practically everything I found sensible but I got absolutly
> > no useful results. In fact I get a jumping and flickering cursor, which
> > also maps differently based upon which direction I move in.
> 
> the rotation matrix is defined as
> 
>     [ cos -sin 0 ]
>     [ sin cos  0 ]
>     [ 0    0   1 ]
> 
> so for a 90 degree rotation you'd use 0 -1 0 1 0 0 0 0 1. However, it's
> important to remember you're rotating around the origin, so if you do rotate
> you need to offset too, so the above example actually becomes.
> 
>     [ 0 -1 1 ]
>     [ 1  0 0 ]
>     [ 0  0 1 ]
> 
> The offset is the important bit, forget about it and you get the cursor
> stuck in corners or edges.

I had the same thoughts and came to the same conclusion, the same
matrix. But I get a randomly jumping cursor then. I thought that maybe,
the device (that touchscreen, again) happend to export two event devices
of which I had then only rotated one, but that isn't the case. Floating
the one device I tried to rotate disables it, completey.

Even if the matrix were wrong, which I tink it isn't, after you just
confimed it, why would the cursor jump arround like crazy?

regards,
Cedric


More information about the xorg-devel mailing list