Hi. After singular success in the flatland, i've stepped in the planet of cubes,spheres and triple-axis.
I'd made a program that 'locks' an enemy and orients the ship towards it.
It's basicaly a dummy object in the center of the seeker ship. It points to destination via "point to " method, the resulting angles are taken as destination for the seeker rotation (using turn, pitch and roll). Now, here comes the horror:
Gimbal lock
Every time the enemy is located more than 90 deg (having deg orientation 0 as z+) the angles get messed up. Result: the ship only chases targets directly in front of it. any thing beyond that narrow cone, makes the ship to go berserk in to the deep space.
any help? please?
9 of every 10 people are exactly the 90 %