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
camera revolving
Moderator: byronnash
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
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]
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.
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.
-
- 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.