2 Replies Latest reply on May 23, 2006 6:05 AM by Newsgroup_User

    rotate object

    sopphinken
      Is there anyway to rotate an object around another object's pivot?
        • 1. Re: rotate object
          James Newton, ACP Level 3
          There are several ways. You can set the other object to be the parent of the object to rotate. You can use multiply() with the transforms of the pivot object and the object to rotate. Or you can simply use the following syntax with the rotate() method:

          v3DMember = member("3D Member Name")
          vObjectToRotate = v3DMember.model("Rotating Object Name")
          vPivotObject = v3DMember.model("Pivot Object Name")
          vPosition = vPivotObject.worldPosition
          vAxis = randomVector() -- replace with the (unit) vector that defines the axis of rotation
          vAngle = random(360) -- replace with the angle you want to turn

          vObjectToRotate.rotate(vPosition, vAxis, vAngle, #world)
          • 2. Re: rotate object
            Level 7
            sopphinken wrote:

            > Is there anyway to rotate an object around another object's pivot?

            Take a look at rotate in the dictionary and the optional parameter
            relativeTo.
            --
            Agust�n Mar�a Rodr�guez

            www.onwine.com.ar > Macromedia Director demos & code