Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

DzQuats and Eulers

$
0
0

I'm trying to track down a problem, and I think it has something to do with the way Daz Studio converts eulers to quaternions, and vice versa.

function doIt() {

 var DEG2RAD = Math.PI / 180;
 var RAD2DEG = 180 / Math.PI;

 var angles = new DzVec3(-20*DEG2RAD,0,0);
 var rot = new DzQuat( DzRotationOrder("XYZ"), angles );

 print( "angles: " + angles );
 print( "rot: " + rot );
}

doIt();

Executing Script...
angles: [-0.349066,0,0]
rot: [0.173648,0,0,0.984808]
Result: 
Script executed in 0 secs 31 msecs.

 

This converts euler angles (-20,0,0) to a quaternion (0.173648, 0,0,0.984808), which I believe is wrong.

My very own code converts (-20,0,0)  to (-0.173648, 0,0,0.984808).  Note the negative sign for x.

I also tried this random online site:
https://www.andre-gaschler.com/rotationconverter/

and it also converts (-20,0,0)  to (-0.173648, 0,0,0.984808).

Why is Daz quaternion conversion so bad?



 


Viewing all articles
Browse latest Browse all 1036

Trending Articles