i came to the term “quaternion” when i was trying to solve a rotating problem with a cube puzzle i’ve been working on and i also found out about something called gimble lock and from my understanding both terms seem to be the fix for my problem.
the cube will be rotating with a keyboard input
its going to be rotated on 2 dimensions (X(roll),Y(pitch))
each keyboard input is going to rotate the cube on a single dimension for example Q is going to rotate on X and E for Y.
now the questions
1- my knowledge on quaternions is very basic so when should i use quaternions in game development in general?
2- do i need quaternion to make the cube rotate since its a puzzle and its not going to be a main game feature or a core feature.
i have another problem now your method works fine but the player is going to rotate the cube until he get the correct cube face facing up in order to solve it.
any ideas on how to do it? i was thinking of ways to make it work but i can’t figure it out especially when u now that there are multiple rotations in order to make the cube face facing the right direction.
the player will rotate on X and Y and will have the freedom to put the cube on which ever face he wants, my question is how do i know when he puts the cube on the platform with the correct face looking down?
now i do know how to make the cube rotate and move but what i dont know is how to tell if the correct cube face is the one that is facing the platform
wow nice it worked, i parented a plane shape to the cube, moved it until it almost hit the correct face and used a box collision volume to trigger when this plane gets inside it.
Well you want to know when that face is pointing downward.
You could have an arrow component pointing outward from the face ( or an empty scene component ). When the dot product of that arrow and the actor down vector is ( approx ) 1, it’s facing downwards