Page 1 of 1

camera revolving

Posted: November 9th, 2008, 9:55 am
by detomaso
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

Re: camera revolving

Posted: November 10th, 2008, 12:28 pm
by Mylenium
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

Re: camera revolving

Posted: November 10th, 2008, 2:03 pm
by detomaso
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.

Re: camera revolving

Posted: November 10th, 2008, 3:26 pm
by kobyg
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.

Re: camera revolving

Posted: November 11th, 2008, 3:30 am
by Paul Tuersley
Or you could just put a 3D null in the center of your universe, parent the camera to it, and rotate the null.

Re: camera revolving

Posted: November 11th, 2008, 8:37 am
by detomaso
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...