3 Replies Latest reply on Feb 1, 2013 1:40 AM by zachary1234-851442

    Bizzare java3D Matrix situation check

      As I understand, column with 0 at the bottom defines the above column
      is an axis vector

      The digits in the right most column represent the streches, or the same, result,
      except the lower right hand cell, which I believe has to be the same as the rest
      of the lowest row.


      Matrix4d initial = new Matrix4d(1,0,0,1, 0,1,0,1, 0,0,1,1, 0,0,0,0);

      Matrix4d result = new Matrix4d();

      System.out.println("Initial targest Matrix:");



      Transform3D transform = new Transform3D(initial);

      Double degrees = new Double(45);

      Double radians = new Double(degrees*Math.PI/180);

      System.out.println("Angle: " + degrees + " degrees");

      AxisAngle4d axisAngleRotate = new AxisAngle4d(1,1,1,radians); //must be equivalent to the Matrix contents.




      System.out.println("Forward Rotation results:");

           It only setRotation() only overwrites the matrix with the updates
           trigonometry values for the rotation matrix. It thus becomes the multipler

      Edited by: Zachary1234 on Jan 30, 2013 5:50 PM
        • 1. Re: Bizzare java3D Matrix situation check
          Perhaps you could start by explaining

          (1) What you think that program does

          (2) What the program actually does

          (3) How the result differs from your expectation
          1 person found this helpful
          • 2. Re: Bizzare java3D Matrix situation check
            The initial matrix is a 4x4 matrix, which contains a 3x3 matrix to the upper left, being the unit vectors in the positive direction on the cartesin 3D plane.
            Under each vector is the digit 0, denoting vectors. I have left the result column, the final 4th column, as straight zero's, which should denote no transformation of the enclosed vector.

            setRotation only OVERWRITES the matrix with the trigonometry for the rotation matrix. It doesn't take the previous matrix as functional values.

            My code actually works as expected.

            Is there anyone out there who can give me the full details about the formatted meaning of the Matrix4d which initialises Transform3D?

            Edited by: Zachary1234 on Jan 30, 2013 5:41 PM
            • 3. Re: Bizzare java3D Matrix situation check
              The answer lies in the nature of what a Rotation Matrix is, and what it never is.

              by going Matrix4d.setRotation(AxisAngle),

              You are altering your initial matrix, being a list of vectors, and putting in their place a correct set of multiplers.
              the result matrix, when multipled by a co dimensional vector, will rotate that later vector's components
              by each value correctly to effect the right angular rotation.

              However, the secondary matrix is by no means a vector, just the correct multipler value arrangement.

              You cannot act to go setRotation(AxisAngle) again, you can only operate on the original Matrix, list of vectors.

              So all is well in this little subspace, in fact, of javaland.