I have a mesh and animate its position, using the method from the docs. I would like the mesh to face the same direction of the path. Here is the current behavior:
How can I rotate the mesh to face the next point?
Note that the points are all 1 unit apart.
First of all well done for finding your own solution to your problem. I am a little concerned that it took you down a wrong path and that understanding a little more about the answers given would have led you to a quicker solution without polar coordinates.
The difference between scene rendering animation and ‘Animation’ is the first calculates during each rendering frame and the second needs to pre fill the animation key frames before doing the animation. The maths for each is the same and so you can convert from one to the other.
Since I already have a position Animation, It was easier to use Animation for both instead of changing the entire (working) position animation to use registerBeforeRender.
I had also considered using registerBeforeRender like the first answer but decided against it because the animation used set 400+ points manually while using Animation is much more readable and significantly easier to edit.
I added some points that form a square to see how it behaves in each. It turns correctly on most but I still havent figured out why it does the long form of the turn in some certain ones. Any help? Thanks!