camera revolving

What type of scripts do you need?

Moderator: byronnash

Post Reply
detomaso
Posts: 5
Joined: May 31st, 2007, 1:45 pm

Hello,

I have a work to do that involves camera movment. I'ts a 3D scene like the universe for exemple. And I would like to make a camera revolving around this universe, in a perfect cercle. Some time ago I had a usefull script that allowed me to do that.The camera was revolving and pointing a the center a the same time. Could you help me ?

detomaso
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

Use expressions:

rCenter=thisComp.layer("center").position;

rRadius=200;

X=rCenter[0]+Math.sin(time)*rRadius;
Y=rCenter[1];
Z=rCenter[2]+Math.cos(time)*rRadius;

[X,Y,Z]

Simply pin down your point of interest with a pickwhip expression to a Null and you are set. Modify values as needed.

Mylenium
[Pour Mylène, ange sur terre]
detomaso
Posts: 5
Joined: May 31st, 2007, 1:45 pm

Thx a lot. Tha's F... cool.
I can see the revolution now. But I have few more questions now...
How can I manage the pace of the animation. In the clip I want to do, I have to stop sometimes to reveal some planet and some text.
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

Instead of "time" in Mylenium's expression, add a Slider Control to a NULL object (or any other existing layer), pickwhip it's value to a variable t and multiply it by "Math.PI/180". Then use the Slider Control as the rotation angle in degrees:
0 - is the starting angle
360 - is the angle after one full revolve
etc.
So by keyframing the Slider Control you can control the rotation, and make it stop at any angle you want.
It should look something like this:

rCenter=thisComp.layer("center").position;
rRadius=200;
t = thisComp.layer("Null").effect("Slider Control")("Slider")*Math.PI/180;
X=rCenter[0]+Math.sin(t)*rRadius;
Y=rCenter[1];
Z=rCenter[2]+Math.cos(t)*rRadius;
[X,Y,Z]

Koby.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Or you could just put a 3D null in the center of your universe, parent the camera to it, and rotate the null.
detomaso
Posts: 5
Joined: May 31st, 2007, 1:45 pm

Thx for your answers, but there might be something I don't understand. No matter what I do, Null or not, with or without slider, the thing is revolving even with no key frame...
Post Reply