Page 1 of 1

### Circle Script easy for anything!

Posted: 10/18/2016, 7:15 am
So i needed light to rotate around object, i always ended up with messed rotation.

So i decided to use my old school Math code from programming

If you have any other idea hit me. i tried alot and this did work best for me.
To rotate in circle and everything else is fixed!

Code: Select all
`r*Math.cos(time)+xCenterr*Math.sin(time)+yCenter`

So you put this into Expression like above.
If you have 3d space and you need light to rotate above and around object you use Z and X
explanation
remember you need to first Separate Dimensions

r= Radius (how far from center does it rotate)
xCenter and yCenter are your values where is positioned example in 2d model 1080p would be x=960 and y=540 rotate around center
time you can leave or multiply or divide
Or you can make 3dimensional rotate sphere like!:)

Quick Example:

### Re: Circle Script easy for anything!

Posted: 10/20/2016, 1:08 am
If I need an object to orbit around a point I usually put a null at that point, parent it to my object then rotate the null.

### Re: Circle Script easy for anything!

Posted: 10/23/2016, 10:34 am
yeah i did that to, but i used it different way i coudnt achive my effect

### Re: Circle Script easy for anything!

Posted: 10/23/2016, 1:21 pm
Hello alenko,

Scenario:
You have a object and you would like the light orbit around the object,
try this:
- create a Null-Object (Layer 3D) in the Center of your object
- create a Light in the Center of your object
- parent the Light to the Null object
- use "Anchor-Point" of the Null-Object to position the Light in the "Orbit"
(example: modify Anchor-Point X value to bring the light in the right position)
- use >>Null-Object >>Rotation
(example: rotate around the Y-Axis)

Hans

Hans

### Re: Circle Script easy for anything!

Posted: 10/24/2016, 3:25 am
Yes this is only for circle rotate,
but i made more complex stuff that i coudnt achive with this.
so i use trigonometric functions for some stuff