I am writing a program to convert
SMD files to an8.
The bones of an smd file are defined by a position and 3 euler angles in radians. I am using the following code to convert to an8
smdbone sb=bones.get(x);
Bone b = new Bone();
b.name=sb.name;
b.length=new Vector3f(sb.x,sb.y,sb.z).length();
b.diameter=.2f;
Quat4f orientation= new Quat4f();
Quat4f xrot=new Quat4f();
Quat4f yrot=new Quat4f();
Quat4f zrot=new Quat4f();
xrot.set(new AxisAngle4f(1,0,0,sb.rotx));
yrot.set(new AxisAngle4f(0,1,0,sb.roty));
zrot.set(new AxisAngle4f(0,0,1,sb.rotz));
orientation.set(xrot);
orientation.mul(yrot);// same as orientation=orientation*yrot
orientation.mul(zrot);
System.out.println("orientation "+orientation.x+" "+orientation.y+" "+orientation.z+" "+orientation.w);
b.orientation=(Quat4f) orientation.clone();[/code]
the output skeleton looks like a torture victim.
any ideas where i'm going wrong?