Lining up the camera


I need a quick answere. I’m trying to line up the camera according to two objects. The two objects are a ball and a flag (in my golf game). I have the xy coordinates for the two objects and the camera needs to on the same line (xy) just behind the ball looking at the ball and the flag.

Is there an easy way to calculate the camera position or do I have to find the formula for the line that goes through the flag and the ball?

I need the answere as soon as possible, so any help would be greate.

Best regards,

  1. put it above the ball
  2. camera.lookAt(flag)
  3. pull it backward

Of course. Thanks :smiley: