ArcRotateCamera animation jitters when the radian difference is too small

pg: https://www.babylonjs-playground.com/#0A4G9Y#1
Hey All. In this playground, you can see that the jitter occurs near the end of the animation. I’ve seen similar topics before.But the new version seems to make this phenomenon more obvious.
This can be reproduced by comparing 4.20 with 5.0.0

ping @PolygonalSun

So I was looking at this and I can see that the jitter is more pronounced in the 5.0 PG as compared to the 4.2 PG. I’m still not sure what specifically is happening but I suspect that it could be something related to the camera’s target handling.

I know that I’ve seen this before when I was making a camera move function and saw a snap/jitter motion when adjusting for the final value to compensate for float precision. This might require more digging to find out what’s changed.

1 Like

This seems to be an issue with floating point calculations with javascript. obviously, if it used to work in 4.2 and doesn’t work in 5.0 there was a change made, but, in general, i would recommend against animating position and target of the arcrotatecamera, mainly because of the calculations required after setting those two.

The arcrotate native parameters are alpha, beta, and radius. If you animate those instead:

arcRotateCamera Animation | Babylon.js Playground (babylonjs-playground.com)

Everything is smoother, performance is better, and rainbow-colored puppies are smiling at you.

2 Likes