Confused on the coordinate

Hi All, I have just implented a sample in Tutorial (pg 31).
In this sample, the posion of camera is changed gradually to LookAtPoint. This job is done by a Lerp node whose “end” is the LookAtPoint. So, I think when the camera stops moving, I should see from LookAtPoint.
Please see the firs snapshot. Since LookAtPoint is behind the robot, I should see his back.
But! In fact I see his side. No matter how I change the LookAtPoint, I alwyas only see his back, his right back!
There must be something I misunderstand.


Hi @pamgu!

Cameras are always tricky to setup :see_no_evil: I remember having these issues in the past! :stuck_out_tongue_closed_eyes:

I think the most likely cause is because the LookAtPoint is the point the camera is looking towards, not where it actually is (the terminology is usually a bit confusing but you can think of the camera position as the ‘source’ and the LookAtPoint as the ‘target’).

Most likely the Entity with the CameraComponent on it will be the source position of the camera, so try moving that to the position you want it to be.

I’ll check out the code next week I can if you’re still having trouble,

Let me know how you get on!

Cheers

Tom

1 Like

Hi, nice to meet you. Thanks for your help. I have checked my coordinate and set them again. Now it works as I expected. :slight_smile:
But I have another thing to report. Please see the “percentage” of Lerp. When I set it to be 2, the code runs maddly. When I set it to 20, the perspective is black. It is really “percentage”, or “ratio”?
7777

Cheers
Gamp

Hi @pamgu,

Glad to hear you got it sorted! :slightly_smiling_face:

Hmm I would suspect that the value for lerp should (usually) only be in the range 0-1 (0.0 is the start, 1.0 is the end), it might be the case that the node internally should really be clamping the value to that range.

For now either only use a number between 0 and 1 or if the number is calculated by another node and fed in, you could use a separate clamp node (I think one exists) to do that manually before you pass the value on.

I hope that helps!

Good luck! :slightly_smiling_face:

Tom

1 Like