About Me

Not Specified
Not Specified


Recent Forum Posts

UT_QuaternionT lerp incorrectly March 6, 2018, 5:48 p.m.

Hey derrick, thanks man! how I find short path? with dot? I use interpolate like weighted sum, when I have Q1…Qn, where weight w(1..n)==1, what I need to do to find short path between several quaternions and do interpolate correctly?

If you are just considering a pair of quaternions, you could use a test like this to tell if they are more than 180 degrees apart: (Q0 * conjugate(Q1)).w < 0

It is less clear what kind of result you are expecting when you have multiple quaternions. Weighted sums of quaternions might not produce the behaviour you expect (you are delving into an area with lots of subtle complications). The idea of shortest path is not so clear in this situation. If your use case has a natural reference orientation, you may want to consider using that as a hint on how the interpolation should proceed.

UT_QuaternionT lerp incorrectly March 5, 2018, 10:51 a.m.

Hey guys, could you help me please, why UT_QuaternionT lerp work incorrectly? What I mean, if you look picture, I do linear interpolate quaternion between two object, first object red rectangle second blue rectangle, so green object rotated between them…. so… problem is when I make angle 210, the green object rotated by long angle… If I use UT_QuaternionT.interpolate() it work correctly… but I need lerp, how I can do linear interpolate correctly?


You are likely providing lerp() with quaternions that are further than 180 degrees apart (remember two quaternions may effectively describe the same rotation but still be a large distance away from each other on the four dimensional surface). Since you want to find the shortest path, you should modify the input quaternions (multiply one of them by -1) so they are no further than 180 degrees apart (of course, this should only be done if your inputs are more than 180 degrees apart).

Wiresolver & orient Feb. 15, 2018, 6:37 p.m.

How is the value you are wishing to obtain different from the “P” attribute? Could you post an example .hip file?