Matrix3dUtil.decompose to get constraint-euler-angle

Software: Away3D 4.x

bxc, Newbie
Posted: 01 June 2014 06:58 AM   Total Posts: 19

when object3D.set transform,I espect to get a constraint-euler-angle from the matrix3d.So I think Matrix3dUtil.decompose should support to this convert.I have figured out the code.Reference<3D Math Primer for Graphics And Game Development>

var sp:Number=-g;//m23
    if(sp<=-1.0){
    tx=-0.5*Math.PI;
  }else if(sp>=1.0){
    tx=0.5*Math.PI;
  }else{
    tx=Math.asin(sp);
  }
  if(sp>0&&(1.0-sp)<MathConsts.EPSILON){
tz=0;
ty=Math.atan2(-i,a);
}else{
ty=Math.atan2(c,k);//m13,m33
tz=Math.atan2(e,f);//m21,m22
}

   
   
‹‹ PLEASE VOTE TO FIX THIS BUG!

X

Away3D Forum

Member Login

Username

Password

Remember_me



X