2 Replies Latest reply on Aug 8, 2008 12:16 PM by Skorpien126

    Setting the transform-property (syntaxproblem)

      The DirectorHelp says that the transform-property can be set. The get-command put(myscene.group("myGroup").transform) works well - like written in the help. But I didn´t get work to set the variable. I´d like directly to manipulate the final transformation matrix because i wrote an Xtra which calculates it. So what is the correct syntax (the help doesnt say anything about this) - something like [(0,1,2,3),(4,5,6,7),(8,9,10,11),(12,13,14,15)] and many other doesn´t work. Any help (if possible with a little example) would be great?!?!?!
      Thanks in advance
        • 1. Re: Setting the transform-property (syntaxproblem)
          To set a transform you need a transform object

          myscene.group("myGroup").transform = myTransformObject

          to create a transform Object you can use the transform method:

          myTransformObject = transform()

          then set each property separately:

          myTransformObject.position = vector(x,y,z)
          myTransformObject.rotation = vector(a,b,c)

          These values (x, y, z, a, b, c...etc) are from your transformation matrix, it means that you need to access to the matrix and get that values and give them to lingo in a way that "it understands". There is no way to "directly" use the transformation matrix.

          finally, when you get myTransformObject completed, assign it to group("myGroup").transform (you get the same result if you set every property of group("myGroup").transform)

          • 2. Setting the transform-property (syntaxproblem)
            Skorpien126 Level 1
            ensamblador thx for the help...
            1) If I can´t apply a transformation-matrix directly, the set-transform-function is absolutly useless.
            2) My knowledge about object transformation (computergraphics/3D) says that the Position-, Rotation- and Projectionmatrix are multiplied in a specific (not sure which one - I currently just remember of 3 matrices ^^) order to form the final transformationmatrix. The matrix myscene.group("myGroup").transform in my case. Because of the matrixmultiplication a direct assignment of x,y,z,a,b,c to an element in my matrix is not possible. (IF THATS WRONG PLEASE CORRECT ME)

            Its possible to manipulate myscene.group("myGroup").transform. But this new matrix wouldn´t be applied. Is there a way to force director to apply the new matrix????

            OK after a few tests I find out that the workaround with the myTransformObject works. Create the Object, copied my matrix to each element of the myTransformObject, set the myTransformObject. A BIGGGGG THX to ensamblador