Hello all, thank you for considering my question.
I have read a lot of questions on Gimbal Lock but none of them covered a situation with the involvement of vectors.
Description:
I have two spheres that are moving in a random path (used timelines for that) and the spheres represent two VR hands. The object that is in the middle is irrelevant, it’s just a mesh.
Goal:
What I’m trying to do is to calculate the rotation that an object between the two spheres needs to rotate using only the two spheres.
Current Approach:
The basic idea that I’m building upon is creating a vector from sphere 2 (white) to sphere 1 (red) then saving it, and in the next frame, I’m calculating the vector’s new position and comparing it to the saved one to get the rotational difference. I’m using Rot from XY node to get the Yaw and Pitch, and Rot from ZX to get the Roll.
Current Problems:
The blueprint seems to be doing fine, except for the Gimbal Lock effect that happens with the Roll element at a certain degree (check [GIF][1]).
Questions:
- Do you think there's a way to fix this problem without changing the basic approach to the problem (*check my failed solution attempt in the Gimbal Sol function blueprint*)
- If you have any experience with quaternions, please share details on how you would use them in this case, and try to be as clear as possible (*I have no experience with quaternions*). Keeping in mind that we're using 2 vectors to calculate the rotation.
P.S.:
You can check the blueprint for this [GIF][1], it’s attached, but it has a lot of trial and error nodes in it, so it might be slightly tedious.
I thank you again for your time.
.