ratchetfreak
449 posts

#12833
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago Procedural when interpolating rotations there are 2 ways you can go, the short route or the long route. Many implementations of quaternion interpolations will always pick the short route by checking if dot(q1, q2)< 0 and when true negating one of the quaternions. instead if you do the work that test can always be false and you save yourself that test. 
Procedural
37 posts
/ 1 project

#12834
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago Edited by Procedural on Aug. 12, 2017, 4:22 p.m. ratchetfreak Oh, exactly. Then it's a bonus point to Gibbs vectors, they simply don't have the long route. :) 
cmuratori
Casey Muratori
818 posts
/ 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero. 
#12845
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago Procedural No, unfortunately the exponential map actually has neither the short route or the long route. They take an erroneous (not torqueminimal) path when interpolating, and thus aren't generally suitable for arbitrary interpolation. This is another reason why you don't want to use them. Quaternions allow you to have both the short route and the long route (you want both  I can't emphasize this enough  it is a fallacy to suggest that not having the long route would be a good thing!), your choice. Quaternions also offer your choice of interpolator, since you can't have both for spherical interpolation: slerp gives you constant speed, but only 2 endpoints, whereas lerp doesn't give you constant speed but supports an arbitrary number of endpoints.  Casey 
Procedural
37 posts
/ 1 project

#12847
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago Edited by Procedural on Aug. 14, 2017, 8:32 a.m. cmuratori I guess I should make this clear that everything you guys say about quaternions is true, no one should have a single doubt about how good quaternions for rotations are. I use them everywhere the day I realized matrices are retarded, and will keep using them because of all the things they can do. But this thread is simply not about quaternions! :) cmuratori Wait, maybe I don't know what the short route means, because I thought it's when an angle exceeds 180° it inverses the axis and rotates 360°  angle, i.e. in other direction, to take the minimal path? This is what I see from numbers Gibbs vector shows, it's what direction example shows in the code from the first page, I can make a 3D example, but a proper fix should be found first to make interpolation work for >90° angle difference without big error accumulation. cmuratori Not sure what you mean by "erroneous path", any path they take in any direction looks applicable for instant and <90° rotations so far, maybe I miss something. EDIT: If it's about torque for >90° rotations (<90° rotations have torque too, but at max the error is 8°, I consider it not big, opinions may vary), I can repeat myself the third time: yes, it's a real deal breaker right now, I think maybe it has a fix I currently miss. 
Procedural
37 posts
/ 1 project

#12848
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago
OR maybe I should stop looking for fixes for obviously broken interpolation of Gibbs vectors and admit that the only elegant and fast way to interpolate is to use a quaternion.
Then I guess the only real use of Gibbs vectors is compression, meaning for saving quaternions in compressed Gibbs form and restoring them to the short route. 
ratchetfreak
449 posts

#12849
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago Procedural if you want compression then you can drop the magnitude of the w component without dividing the other components with them. Then just keep the sign bit or have some other way of restoring that sign bit. 
Procedural
37 posts
/ 1 project

#12850
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago ratchetfreak Eh, sounds like a lot of work compared to just dividing by w to compress and extracting axis and angle to decompress :) 
Procedural
37 posts
/ 1 project

#12851
3D rotations with 3D Gibbs vectors in place of 4D quaternions 1 year, 10 months ago
On the second thought, if you encode that sign bit into one of the vector components, then it'll be faster for computer to compress and decompress than divides and atan with equal amount of space needed...
