I’m having a lot of difficulties with the rotation of an object that is moving. The way I calculate the rotation is by taking the angle between point n and point n+1 like so
I then add a keyframe of that angle into the fcurve. This gives the correct angle for the object. However the problem I’m having is that the interpolation of the fcurve causes my object to make a priouette around its axis when it moves from some quadrant to another (see screenshot). How can I fix this?
Sorry I wasn’t clear enough. It’s going to be a boat that follows a path generated from a list of coordinates seperated by identical time intervals. The path you see on screen is the path it takes, but it’s not constrained to it, the path is just there as a visual aid. The way it follows the path is by adding an x,y fcurve point for each coordinate in my data set. The narrow end of the object you see in the screenshot should point in the direction of the path, which it does with the method I posted previously, however not in the cases where the direction moves to a different quadrant. I hope this is enough info.
It seems to me you’ve got to allow somehow for a negative number in your tuple changing to a positive and vice versa. Perhaps you need to work with absolute values and put in some ‘if’ statements to cover those times when you cross from one quadrant to another. This is assuming that by ‘quadrant’ you mean crossing a mid-point on the xy graph.
On the negative side of the x axis, add instead of subtract. That kind of thing.
Best I can give you; hope it at least gets the synapses firing.