How to rotate a camera around a target object in Speckle Viewer?

Hi @Vitalii

Your approach for this is correct! However Speckle uses a coordinate system where Z is up, so you’d have to change

const fixedHeight = initialPosition.z; // Fixed height

and

const position = new Vector3(
  center.x + Math.cos(angle) * radius, 
  center.y + Math.sin(angle) * radius, 
  fixedHeight 
)

Alternatively, this 360 screenshot is already implemented in our sandbox by pressing the ‘360’ button. The implementation is here. Using either will get you the result you are looking for

Cheers

1 Like