How to keep the camera in its original state after pausing

I drew a path using three’s THREE.SplineCurve3 class, and as the camera walked along the path, I clicked the pause button, and the camera could not remain in its original state. It flips. How do I solve it? I hope you can help.
QQ%E6%88%AA%E5%9B%BE20180124101537
QQ%E6%88%AA%E5%9B%BE20180124101613
The first picture is the state of the camera’s motion, the second is the state of the camera’s pause, and the state of the first picture cannot be maintained after the pause.

If you show us the code you have or, better, a working example.

Here’s my code for camera animation:

if ( pos < 1 ) {

   position = Viewer.toCameraPath.getPointAt( pos );
   camera.position.set( position.x, 6.5 , position.z - 0.1 );
   controls.target.set( position.x, 6.5, position.z );
   tangent = Viewer.toCameraPath.getTangentAt( pos ).normalize();
   axis.crossVectors( up, tangent ).normalize();
   radians = Math.acos( up.dot(tangent) );
   camera.quaternion.setFromAxisAngle( axis, radians );
   pos += flagRoom;

} else {

   pos = 0;

}

Having this information and the code for camera animation, should we somehow reproduce your interface and its code ourselves?

This code is just the path of the camera.

I’m afraid it will be hard to solve your problem if you don’t provide a live example. Try to reduce the unexpected behavior to a minimal test case. That way, it will be more likely to get useful tips from the community.

1 Like