1 Reply Latest reply on Oct 17, 2010 3:52 PM by Shongrunden

    Matrix3D to center rotationY - why is this so difficult to do?

    aaronfg_

      I can't seem to find a single tutorial on how to make any object have it's 3D registration point in the center so that I can set rotationY on a timer loop and have it stay centered instead of being at 0,0.

       

      This takes 2 seconds in the Flash UI with alignments.

       

      I'm bashing my head against the wall trying to figure out how to do this via code.

       

      Can anyone help?

        • 1. Re: Matrix3D to center rotationY - why is this so difficult to do?
          Shongrunden Adobe Employee

          If you are using the spark effects you can set the autoCenterTransform property to true, for example:

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark">

           

              <fx:Declarations>
                  <s:Rotate3D id="myEffect" target="{myButton}" angleYFrom="0" angleYTo="360" autoCenterTransform="true" />
              </fx:Declarations>
             
              <s:controlBarContent>
                  <s:Button label="play" click="myEffect.play()"/>
              </s:controlBarContent>
             
              <s:Button label="target" id="myButton" width="100" height="100" x="100" y="100" />
             
          </s:Application>