facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.7k stars 1.3k forks source link

Matrix to Quaternion function requires quaternion standardization at the end. #1703

Closed GostInShell closed 9 months ago

GostInShell commented 9 months ago

The current implementation handles the near zeros value really well by computing with the largest denominator. However, this will leave the w to be not always positive. Though it will not affect general operation like multiplication, it can result in unexpected behaviors in quaternion blendings.

Moreover, this only happens when the trace is near zero making it more mysterious and unpredictable. I am currently implenting a dual quaternion blending function with it, and it really takes me several good days to find out the reason.

So I suggest add a line of standardize at the end.