I'm trying to write an animation sequence for a video game engine that uses quaternions. I've never worked with quaternions before and even though I've spent hours trying to get my head around them, I'm still struggling to apply them to my problem.
Basically, I need to be able to send objects on a path that would be easy to graph in cartesian space but I have to do it with a dual quaternion system. For simplicity's sake, let's just say I have a cylinder with a "nose" end and a "tail" end I need to animate it following a parabolic path to simulate being thrown at a target on the ground. I managed to make it go in a straight line from resting on the ground at the origin, on a path towards the target. However I can neither tell it the coordinate of the target to make it stop when it gets there, nor can I arc its path upwards to simulate flying through the air.
python code for quaternion stuff
The linked image shows the portion of my code that's incrementing the quaternion coordinates to make the cylinder move. It's Python code but it shouldn't really matter because all that's happening there is basic math. I'm not changing quaternion 2 in a mirrored way to changes to quaternion 1 because I'm trying to translate as well as rotate my cylinder, and I don't want it staying on the same sphere. So the changes to q1 are all commented out. When q2_x is incremented and nothing else is changed, then the cylinder moves in a straight line towards the target. When I added the q2_y = -(q2_x * q2_x) + (.005*q2_x) bit, I expected it would move in a parabolic shape but instead it starts to move in a weird screw-shape briefly, before gliding off into the void on a straight path. I was also really confused when I noticed that the amount that I increment q2_x (eg. -=1 versus -=.005) results in a different path but not a significantly different speed of motion. What am I misunderstanding here?
So, to summarize, my question is: how can I model simple motion along a pre-set path in 3 dimensions using quaternions as the coordinates?