1 Reply Latest reply on Oct 30, 2015 5:34 AM by Marc Autret

    What is the origin for the absoluteRotationAngle? [See description for details]

    ajaatshatru

      Screen Shot 2015-10-29 at 19.24.43.png

       

      As you can see, the image has been rotated while the container is as it is. Now the absoluteRotationAngle gives the angle of rotation with respect to the container. Hence if I wish to rotate the points accordingly, I need to translate them the origin, apply the rotation and then translate back. My question is what are the coordinates of the origin and how to get it?

        • 1. Re: What is the origin for the absoluteRotationAngle? [See description for details]
          Marc Autret Level 4

          Hi ajaatshatru,

           

          The property absoluteRotationAngle—which by the way is totally misnamed—reflects as a degree angle the rotation attributes of the object transformation matrix—that is, relative to the parent coordinate space. The transformation matrix in itself does not specify any origin, since coordinates are computed by just applying that matrix, which contains translation attributes. However, you can specify a “temporary origin” when you are applying a transformation (using e.g. the transform method.) In that case it is possible to provide a location—any location—and to apply a rotation relative to that point. The resulting transformation matrix will then reflect the resulting state of the object (rotation, translation, etc.), but the temporary origin used during the rotation is not recorded at all.

           

          Anyway, if you don't deal with explicit transform methods and just want to (re)set the absoluteRotationAngle property, you have to consider the current transform reference point as the implicit origin of that transformation. For example, if the transform reference point is currently the center anchor in the GUI, then the center point of the inner bounding box (in your screenshot, the center point of the brown rectangle) will behave as the origin of the rotation. Indeed, (1) changing only the rotation attributes of a transformation matrix has no effect on the translation attributes, and (2) the center point of the inner bounding box is known to be invariant as long as no translation occurs. By contrast, if the current transform reference point is, say, the top-left anchor, then the rotation will occur relative to that origin; and so on.

           

          @+

          Marc