Glm - Which function is the alternative to ofQuaternion::makeRotate(vec1, vec2)?

ofQuaternion defines a function:

void ofQuaternion::makeRotate( const ofVec3f& from, const ofVec3f& to );

But it seems there’s no such function in glm. I’ve been spending some time on converting old code base into the new glm-compatible version, and this function is critical.

(toOf() and toGlm() is a quick workaround for this though)

What exactly is this “rotates vec1 to vec2” doing, and what’s the glm way to achieve this?

@arturo - Seems like you have been spending a lot of time for converting the code base into glm compatible version, it would be great if you could give me an advice - thanks.

i think glm::rotation(vec1, vec2) is the same as makeRotate

Ha! I’ve been confused by the overloads of glm::rotate() and missed glm::rotation(). Thanks for the reply!