user5839 - 1 year ago 79

Javascript Question

I've placed a load of items in a circle around a camera, and the objects appear in a counter-clockwise direction with this code

`answer.position.y = Math.sin(answerBoxRadians) * circleRadius;`

answer.position.z = Math.cos(answerBoxRadians) * circleRadius;

answer.rotation.x = Math.PI - answerBoxRadians;

How do I reverse the math so they appear in a clockwise direction?

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

It's because positive angle is counter-clockwise. Put your angle as negative and you'll get the order in clockwise.

```
answer.position.y = Math.sin(-answerBoxRadians) * circleRadius;
answer.position.z = Math.cos(-answerBoxRadians) * circleRadius;
```

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**