•      Sign In
• Create Account

### #ActualKoga73

Posted 10 December 2012 - 05:00 PM

Yeah as for rotating zero in my example I know it doesn't do anything it was just easy math for me to show what I expect the resulting point to be. As you stated above applying the rotation to (distance, 0, 0) does work!

var quat:Quaternion = new Quaternion();
quat.fromAxisAngle(new Vector3D(0, 1, 0), rot * MathConsts.DEGREES_TO_RADIANS);

var mat:Matrix3D = new Matrix3D();
mat.position = new Vector3D(10, 0, 0);
mat.append(quat.toMatrix3D());

plane.position = mat.position;


This is good and all but now I want to abstract it out into a function that takes in an axis vector, an angle, and a distance. It doesn't seem like the same code above would work if the axis were not the Y due to the position being hard-coded to (distance, 0, 0). I guess at this point I'm just looking for what that vector should be? The magnitude should always be the distance but does it matter what value I start it at?

### #1Koga73

Posted 10 December 2012 - 04:59 PM

Yeah as for rotating zero in my example I know it doesn't do anything it was just easy math for me to show what I expect the resulting point to be. As you stated above applying the rotation to (distance, 0, 0) does work!

var quat:Quaternion = new Quaternion();
quat.fromAxisAngle(new Vector3D(0, 1, 0), rot * MathConsts.DEGREES_TO_RADIANS);

var mat:Matrix3D = new Matrix3D();
mat.position = new Vector3D(10, 0, 0);
mat.append(quat.toMatrix3D());

plane.position = mat.position;


This is good and all but now I want to abstract it out into a function that takes in an axis vector, an angle, and a distance. It doesn't seem like the same code above would work if the axis were not the x due to the position being hard-coded to (distance, 0, 0). I guess at this point I'm just looking for what that vector should be? The magnitude should always be the distance but does it matter what value I start it at?

PARTNERS