0 Replies Latest reply on Feb 23, 2015 11:29 AM by Fivezdw Fivezdw

    Need help. How to move a component along x axis?

    Fivezdw Fivezdw

      I would like to move a component along +x,-x,+y,-y,+z and -z direction for a given distance. For example: 1 meter.

      I think i need to use math transformation by creating a transformation matrix. below is the code I wrote for transformation in +x direction for 1 meter.(in C#)

      I was wondering if this code will work?

      I learned from somewhere that the rotation submatrix is diagonal with diagonal entries to be 1 for pure translation. And the translation vector denotes the direction of translation.

       

      MathTransform swXform = default(MathTransform);

      MathUtility swMathUtil = default(MathUtility);

               

      double[] arr=new double [16];

       

      arr[0]=1; arr[1]=0; arr[2]=0;

      arr[3]=0; arr[4]=1; arr[5]=0;

      arr[6]=0; arr[7]=0; arr[8]=1;

      arr[9]=1; arr[10]=0; arr[11]=0;

      arr[12]=1;

      arr[13]=0;arr[14]=0; arr[15]=0;

       

      swXform = swMathUtil.CreateTransform(arr);

       

      Or if there is any other way to accomplish the event. Any help will be really appreciated.