Regina Henschel schrieb:
Hi Armin,Armin Le Grand schrieb:Regina Henschel schrieb:
<-----stuff removed---->
Yes. For historical reasons, the OOo Drawinglayer has a right-handed 2D coordinate system, that means the Y-Axis points down (as can be seen in the positions dialog; the bigger the position, the more downward on the page is the object).I'm aware of that. This also has the consequences, that allmathematical stuff related to a left-handed coordinate system as we learn it in school is 'mirrored' in Y. This is true for shear and rotation angle values (e.g. positive rotation goes clockwise).2) If it is correct, how is the transformation to be used?Keep in mind that You are working with a right-handed coordinate sytem.It is not clear, how to use the matrix.Perhaps let's take a more simple example, were the center of the operations are in the origin. (Please correct me were I'm wrong.)Take a line
A line is unfortunately a bad example; it does not really get transformed from the tought unit line from (0,0) to (1,0), but internally creates a two-point polygon with the points where they belong and no transformation at all. Could You use a rectangle as example, please? This will make things more reliable to reproduce.
The transformation for a rectangle implies to be applied to a unit rectangle from (0,0) to (1,1), thus completely defining position, size, rotation and shear of the shape. The order is:
M = MTranslate * MRotate * MShearX * MScale
of course multiplied from right to left as usual in matrix notation.
I also need to know on which level You get the matrix: From ODF
FileFormat, from UNO API or from SdrObject level? This is not always the
same, unfortunately...
from (0cm|-1cm) to (0cm|1cm). With 1/100mm in integers that
is in model coordinates a line from (0|-1000) to (0|1000). It gets the transformation matrix0 0 0 0 2000 -1000 0 0 1 That is as expected so far.Now apply a rotation with 30° (30° entered in position&size dialog). The rotated line has the coordinates (those which one can see on screen) from (-0.5cm|-0.87cm) to (0.5cm|0.87cm)It gets the transformation matrix 1000 0 -500 0 1732.05 -866.02 0 0 1 I apply the matrix / \ / \ / \ | 1000 0 -500 | | 0 | | -500 | | 0 1732.05 -866.02 | * | 0 | = | -866.03 | | 0 0 1 | | 1 | | 1 | \ / \ / \ / / \ / \ / \ | 1000 0 -500 | | 1 | | 500 | | 0 1732.05 -866.02 | * | 1 | = | 866.03 | | 0 0 1 | | 1 | | 1 | \ / \ / \ /which gives the model coordinates (-500|-866) and (500|866). That fits to the coordinates on screen and is as expected.Now remove the rotation and set a 20° shearing (in position&size dialog). The sheared line goes from (0.36cm|-1cm) to (-0.36cm|1cm).
As said, shear of a line is problematic since a line has no 'Height' when looking at the line unit shape. A ShearX on a shape with no height would do nothing. I would need to look at the code what internally happens when You do this using the dialog. Could You try this with a rectangle, please?
It gets the matrix 727.94 0 -363.97 0 2000 -1000 0 0 1 I apply the matrix / \ / \ / \ | 727.94 0 -363.97 | | 0 | | -363.97 | | 0 2000 -1000 | * | 0 | = | -1000 | | 0 0 1 | | 1 | | 1 | \ / \ / \ / / \ / \ / \ | 727.94 0 -363.97 | | 1 | | 363.97 | | 0 2000 -1000 | * | 1 | = | 1000 | | 0 0 1 | | 1 | | 1 | \ / \ / \ /That gives the model coordinates (-364|-1000) and (364|1000). That does not fit the coordinates on screen, the x-coordinate has opposite sign.I'm confused. kind regards Regina --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
