... this post was updated on ProVideo Coalition as Spirographs in After Effects.
Note: code from comments by Jason Lee Peacock,
I've recently been looking into this topic myself, but within a 3D space (thanks to the modified code of Dan Ebberts) http://twitpic.com/1ao7d0 , having seen this via Quba Michalski http://qubahq.com/2005/08/sine-sphere/
http://twitpic.com/1bscaz .. Literally clueless to the math ( http://tinyurl.com/yeg37lt ) I just kept tweaking Dan's code until I got the result I was after..
r = 200; //radius of sphere
Theta = Math.PI*time*5*Math.sin(10)/2;
Phi = Math.PI*time*1/2;
theta = ease(time,Theta,Theta);
phi = ease(time,Phi,Phi);
sinPhi = Math.sin(phi);
x = r*Math.cos(theta)*sinPhi;
y = r*Math.sin(theta)*sinPhi;
z = r*Math.cos(phi);
center = thisComp.layer("Null: Center").position;
center + [x,y,z]
4 comments:
I've recently been looking into this topic myself, but within a 3D space (thanks to the modified code of Dan Ebberts) http://twitpic.com/1ao7d0 , having seen this via Quba Michalski http://qubahq.com/2005/08/sine-sphere/
Plese tell more on the modified code of Dan Ebberts...
http://twitpic.com/1bscaz .. Literally clueless to the math ( http://tinyurl.com/yeg37lt ) I just kept tweaking Dan's code until I got the result I was after..
r = 200; //radius of sphere
Theta = Math.PI*time*5*Math.sin(10)/2;
Phi = Math.PI*time*1/2;
theta = ease(time,Theta,Theta);
phi = ease(time,Phi,Phi);
sinPhi = Math.sin(phi);
x = r*Math.cos(theta)*sinPhi;
y = r*Math.sin(theta)*sinPhi;
z = r*Math.cos(phi);
center = thisComp.layer("Null: Center").position;
center + [x,y,z]
Brilliant Jason! This is exactly what I was looking to add to my tut. I worked with Dan a little bit, but couldn't come up with a good way to do this in 3D space cuz I'm just as lost on the math as most.
Thanks!
Post a Comment