How to get the position Vector3 past the controls.target Vector3 position?

If I do. this:

  const CAMERA_POSITION = new THREE.Vector3();
  const TARGET_POSITION = new THREE.Vector3();

  CAMERA_POSITION.copy(camera.position);
  TARGET_POSITION.copy(controls.target);

  CAMERA_POSITION.lerp(TARGET_POSITION, -0.5);

That works great to get the interpolated position further from the controls.target.

How would I do the same but going towards the controls.target but also PAST it? Changing -0.5 to 0.5 can only get me closer but never past that point. I don’t know how to get the interpolated point from the camera position-controls target position vector past the controls target position.

Once I get that point past controls.target, I would then set that to the new value in order to allow my camera to go beyond that point.

I’m basically trying to get the controls.target position to adjust as I get closer to it so that I don’t bump and stopped on it.

Try 1.5, because 0.5 will be the midpoint:

(or -0.5, but with swapped positions)

1 Like