Is there any function to convert Euler angles to quaternions in script
#3
tyFlow doesn't have a built-in euler to quaternion function because the result is not well-defined, due to vectors not containing enough data to fully define a quaternion.

That said, I guess the equivalent would be tyFlow's 'MatrixFromVector' function, which you could then derive your quaternion from (same limitation about ambiguity of result applies).

Code:
for (int i = 0; i < eventParticleCount; i++) //this for-loop iterates through all particles in this event                
{
    var sInx = tf.GetSimIndex(i);
    
    var vec = new Point3(-0.5f, 0.2f, -.75f);
    tf.SetRot(sInx, new Quat(MatrixFromVector(vec.normalized)));    
}
  Reply


Messages In This Thread
RE: Is there any function to convert Euler angles to quaternions in script - by tyFlow - 04-03-2023, 01:36 PM

Forum Jump: