Objects looking at camera

This is a new thread for @MDH questions in this thread

Another thing I haven’t figured out yet:
I would like to have the planes all look to the camera. As I understand it, the “lookAt” node might be the right path to choose. However, I have not yet understood how to enter the camera as a target. Simply copying the position (‘t’) values of the camera into the “target” vector3 input fields as absolute values didn’t work at least. Do you have a tip for me in this regards?

Yes, the sop/lookat isn’t really designed for animation. Also, for performance reasons, the parameters of the camera doesn’t really reflect its position. You can use those to set the position, but not really to read it.

In order to have objects doing a lookat on every frame, it’s more performant to use the actor nodes. Those are the nodes used to add behaviors. Here is a quick introduction:


And you’d need a setup like this (make sure to hit play for the actor nodes to be executed):

And since it’s such a common use case, I’ve just put an example scene: https://polygonjs.com/demo?example=bynode/actor/setobjectlookat/camera

1 Like

Very cool. Works just fine. Thanks again. :sunglasses:

1 Like