Skip to content

Instantly share code, notes, and snippets.

@lyokato
Created May 23, 2018 03:20
Show Gist options
  • Save lyokato/b62089f3dfdfc6d74c7999d6c58cd2c4 to your computer and use it in GitHub Desktop.
Save lyokato/b62089f3dfdfc6d74c7999d6c58cd2c4 to your computer and use it in GitHub Desktop.
public Quaternion GetVector()
{
Quaternion q = Quaternion.AngleAxis( 90.0f, Vector3.right );
Vector3 v1 = q * new Vector3(j_b.x, i_b.x, k_b.x);
Vector3 v2 = q * -(new Vector3(j_b.z, i_b.z, k_b.z));
if (v2 != Vector3.zero){
return Quaternion.LookRotation(v1, v2);
}else{
return Quaternion.identity;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment