Best practise for camera rotate over POI

I want to present a model on the map, and let it spin automatically. So I want to set the camera rotate over this model slowly.

I kinda achieved by using a method I don’t really feel elegant:

  1. I use viewer.camera.lookAt(myModelPosition, HeadingPitchRange)

  2. Then i call it every 0.1 sec with a smaller heading value.

Could anyone help with a more elegant way?

Thanks.

Ciao

Maybe you can adapt the solution presented by HyperSonic here: How to circle around a model/entity / viewer.flyTo() path
-> Define a given time to move from heading A to heading B instead of many individual headings.

Thanks Martin,

So it’s similar logic of what I’m doing now. So i guess there is no more elegant way. (like set a path for camera to circle)

Best,

Narco