How can auto rotate camera around the object?

I want to auto rotation camera around an object without OrbitControls or any …
I have object position and distance
Does anyone know?

controls.autoRotate = true

I don’t want to use the OrbitControls

Try it with Math.cos() and Math.sin(): Edit fiddle - JSFiddle - Code Playground

1 Like

didn’t catch the “without”, no harm done :smile:

ps. there’s an easier way using pivots. put the camera into a 0/0/0 group, position the camera outwards say 0/0/10, now just increase group.rotation.y and you have it.

1 Like

I also recommend what @drcmda suggests. This is basically a “spring arm” technique. You’ll find the same principle applied in most game engines, especially for 3rd person cameras.

Can we rotate camera the same way but just on scroll? with gsap?

I want to do a full 360 degree orbit around my object on scroll. Can anyon help with this?

I dont know how to use gsap. Pure javascript:

Gave the easiest solution, no cos or sin needed.