“平均"四元数? [英] "Average" of multiple quaternions?
问题描述
我正在尝试在OpenGL程序中将矩阵动画从矩阵转换为四元数,但是遇到了一个问题:
I'm trying to make the switch from matrices to quaternions for skeletal animation in my OpenGL program, but I've encountered a problem:
给定多个单位四元数,我需要得到一个四元数,当用于转换向量时,该四元数将给出一个向量,该向量是每个四元数分别转换后的向量的平均值. (对于矩阵,我只需将矩阵加在一起并除以矩阵数即可)
Given a number of unit quaternions, I need to get a quaternion that when used to transform a vector will give a vector that is the average of the vector transformed by each quaternion individually. (with matrices I would simply add the matrices together and divide by the number of matrices)
推荐答案
I tried Slerping the quaternions as suggested here but that didn't work for what I'm trying to do (model was distorted), so I simply ended up transforming the vectors by each quaternion and then doing an average (until I can find a better solution).
这篇关于“平均"四元数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!