Page 1 of 1

Circle Script easy for anything!

PostPosted: 10/18/2016, 7:15 am
by alenko
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)+xCenter
r*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:

Image

Re: Circle Script easy for anything!

PostPosted: 10/20/2016, 1:08 am
by Gerry Clark
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!

PostPosted: 10/23/2016, 10:34 am
by alenko
yeah i did that to, but i used it different way ;) i coudnt achive my effect :)

Re: Circle Script easy for anything!

PostPosted: 10/23/2016, 1:21 pm
by hans123
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!

PostPosted: 10/24/2016, 3:25 am
by alenko
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 ;)