Skip to content
Discussion options

You must be logged in to vote

I solved the problem. glMatrix library has the rotationTo function: https://glmatrix.net/docs/quat.js.html#line652

/**
 * Sets a quaternion to represent the shortest rotation from one
 * vector to another.
 *
 * Both vectors are assumed to be unit length.
 *
 * @param {quat} out the receiving quaternion.
 * @param {ReadonlyVec3} a the initial vector
 * @param {ReadonlyVec3} b the destination vector
 * @returns {quat} out
 */

The C++ version of GLM does not have the same function. I just have rewritten the rotationTo function to C++ and Python. This function allow to find a quaternion between vec3 x_axis = { 1.f, 0.f, 0.f } and the unit line segment vector. So, I solved the problem with De…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 8Observer8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant