5 Replies Latest reply on Jun 22, 2010 8:42 AM by James Newton, ACP

    Easy Question (transform)

    Sharkmenace Level 1

      How do I convert a transform from world transform to local transform?

        • 1. Re: Easy Question (transform)
          Sharkmenace Level 1

          any ideas?

          a world transform vector converted to the local space of an object?

          Is there a built in method? Or will this have to be done by hand?

          • 2. Re: Easy Question (transform)
            James Newton, ACP Level 3

            Can you give a little background to your question?  What are you trying to achieve? Are you looking for a mathematical solution or a solution which changes the node hierarchy?

            Let's imagine that you have a "hat" model and a "head" model and that you want to know what the transform of the "hat" is relative to the "head".


            vMember = member("3D World")
            vHat = vMember.model("hat")
            vHead = vMember.model("head")
            -- Change the parent of the hat...
            vParent = vHat.parent
            vHead.addChild(vHat, #preserveWorld)
            -- ... grab the transform in the new frame of reference...
            vLocalTransform = vHat.transform.duplicate()
            -- ... and revert to the original parent
            vParent.addChild(vHat, #preserveWorld)

            Does that give you what you are looking for?

            • 3. Re: Easy Question (transform)
              Sharkmenace Level 1

              thank you. that information could be helpful.

               

              But to be more precise:

              take a random vector in world space v = vector(0,0,1)

              take a spehere or cube with some constantly varying orientation but constant velocity of v

              and lets say we need to know what v is in the local space (which obviosly will not be vector(0,0,1)

              but now that I have explained it and thought about it, I think I may have the answer.

              I have to run back to work. just came home to walk the dogs.

              if the solution presents itself I will post it so that others who may find it useful can see it.

              • 4. Re: Easy Question (transform)
                Sharkmenace Level 1

                Wow. Since 2004, I have never had a question answered. Wether in Flash or Director. Amazing!

                • 5. Re: Easy Question (transform)
                  James Newton, ACP Level 3

                  Are you suggesting that you still have a problem and you are still looking for an answer?  Or, on the contrary, that you have found the answer to your question?  If you have found the answer, would you like to post it here so that others can share your discovery?