rawData => Matrix3D => translation + orientation : need help !

Software: Away3D 4.x

Avatar
rkn14, Newbie
Posted: 28 April 2012 03:06 PM   Total Posts: 13

Hi,

There should be something wrong with my code.

I have a rawData (Vector.<Number>) like this :
1.6653345369377348e-16,-2.0276016243769845e-7,1,0,2.0531461899133812e-23,1,2.0276016243769845e-7,0,-1,-2.0531461899133812e-23,1.6653345369377348e-16,0,0,0,0,1

I convert it to a matrix3D like that :
var matx : Matrix3D = new Matrix3D();
matx.rawData = myRawData;

Then i want to get translation and orientation data, i do like this

var v3:Vector.<Vector3D> = matx.decompose(Orientation3D.QUATERNION);
   
   
var translate : Vector3D = new Vector3D();
translate.x = v3[0].x;
translate.y = v3[0].y;
translate.z = v3[0].z;

var orientation : Quaternion = new Quaternion();
orientation.x = v3[1].x;
orientation.y = v3[1].y;
orientation.z = v3[1].z;
orientation.w = v3[1].w;


Then, if i re-compose a new matrix3D from my orientation and translation, like that :

var mat2 : Matrix3D = orientation.toMatrix3D();
mat2.appendTranslation(translate.x, translate.y, translate.z);

and if i compare the rawData of mat2.rawData to my initial rawData, it’s different !

i get that :
0,-2.0276016243769845e-7,0.9999999403953552,0,0,0.9999999403953552,2.0276016243769845e-7,0,-0.9999999403953552,0,0,0,0,0,0,1


Could someone tell me what’s wrong in my way to do that ?

Thanks !!!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X