Camera interpolation

This is a general 3D question, not specific to Java3D, altough that’s what I’m using.

I’m trying to move my camera between two points in 3-space. There’s also a change in orientation involved. Interpolating the position is a no brainer. I found that by using quaternions to represent the orientation, I can interpolate using “great circle interpolation” (I think this is also called SLERP?). It mostly works, but the interpolation seems to break down when interpolating between certain orientations. By breakdown, I mean the current camera orientation converges toward the target orientation, but never quite makes it, and ends up bouncing around some other intermediate orientation, never getting to the target orientation.

Is this a common problem with quaternions? Am I doing something wrong? Is there a better way to accomplish this?

Here’s a chunk of code I’m using, which gets executed on each frame (*Rotation is a Quat4f, *Location is a Vector3f):

public void stepFrame() {
    transformGroup.getTransform(currentTransform);
    getTargetTransform(targetTransform);
    targetTransform.get(targetRotation, targetLocation);
    currentTransform.get(currentRotation, currentLocation);

    targetLocation.interpolate(currentLocation, 0.8f);
    targetRotation.interpolate(currentRotation, 0.8f);
    targetTransform.set(targetRotation, targetLocation, 1);

    transformGroup.setTransform(targetTransform);

}