How to calculate next camera position to look at the object that changed rotation

Hey everyone,

I’m trying to set up my camera so that it always looks at an angle from the top of the object. The problem is my vector maths is a little bit iffy and Im struggling with the concept of calculating both the position and the rotation of the camera so that it always ends up looking at the plane. Now I know I could do that if I attached the camera to the object but that will stop me from being able to delay the camera and provide a nice experience for the user so that they will actually notice the change in rotation.

Any tips about doing that?

The moving object takes into account the movement of the mouse.

I will appreciate all the input.

Kind regards,

P.S. if my point was a bit vague in explanation I’m attaching a picture so that you can see how I would want to move the camera from the first illustration to the next.

What about the LookAt method in the GameObject class? Your drawing makes it look like you’re working in 3D space, so that should work, shouldn’t it?