正确归一化对偶四元数 [英] Properly normalizing a dual quaternion

查看:107
本文介绍了正确归一化对偶四元数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在处理双四元数时遇到了问题,我相信这是因为它们没有正确归一化.A、B 和 A' 是对偶四元数,其中后者是共轭的.这样做时:Q = A * B * A'如果 A 和 B 正确归一化,我理论上应该总是以 Q = B 结束.但在某些情况下,我不这样做,这完全弄乱了我的整个骨架层次结构.

I'm having trouble with dual quaternions, and I believe it's because they're not properly normalized. A, B and A' are dual quaternions where the latter is conjugated. When doing this: Q = A * B * A' I should theoretically always end up with Q = B if A and B are properly normalized. But in some cases, I don't, and it's completely messing up my whole skeletal hierarchy.

许多页面表明对偶四元数的范数是 ||Q||= sqrt(QQ'),但这意味着取对偶数的平方根,我不知道该怎么做.所以现在我只是将整个事物除以实部的长度.

Many pages show that the norm of a dual quaternion is ||Q|| = sqrt(QQ'), but that means taking the square root of a dual number, and I have no idea how to do that. So right now I'm just dividing the whole thing by the length of the real part.

我已经搜索了好几天,但我仍然没有找到一个关于如何使用双四元数的好的代码示例.我觉得我很了解这个理论,但我仍然无法让它发挥作用.

I've been searching around for days, but I still have yet to find a good code example on how to use dual quaternions. I feel I know the theory pretty well, but I still can't get it to work.

推荐答案

来自 glm 源代码:

From glm source code:

template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P> normalize(tdualquat<T, P> const & q)
{
    return q / length(q.real);
}

我检查了 operator/ 实现.它只是用浮点数将两个四元数分开.

I checked the operator/ implementation. It just divides both quaternions with a float.

这篇关于正确归一化对偶四元数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆