Site icon ProVideo Coalition

Fly around CC Sphere in After Effects

Fly around CC Sphere in After Effects 2

As noted by Andrew Devis, “cameras are notoriously difficult to get to grips with in After Effects” (see video at bottom). Once example is trying to fly a camera around a CC Sphere layer, which isn't really 3D.

Flying a camera around a CC Sphere layer in After Effects can be executed with different expressions, and even an AE script (scroll down for the latter). The most popular variant of solutions is from Dan Ebberts in various place /s, explained once-upon-a-time by Chris and Trish Meyer in Making older 3D plug-ins follow 3D cameras (from DV Magazine in 2001), and explained one way by Andrew Kramer in his After Effects tutorial video 41b. The Blue Planet in 3D:

Here are the expressions for X, Y & Z-rotation use above as explained by Chris Meyer and Andrew Kramer:

Paste this code into the X rotation:
value + lookAt(thisComp.activeCamera.toWorld([0,

­0,0]),position)[0]

Paste this code into the Y rotation:
value + lookAt(thisComp.activeCamera.toWorld([0,­0,0]),position)[1]

Paste this code into the Z rotation:
value + lookAt(thisComp.activeCamera.toWorld([0,­0,0]),position)[2]

 
It's untested here, but Rick Gerard says that the Z value isn't needed: “Draw an equator on your planet and you'll quickly see the problem. You can fix the problem by removing the expression from CCSphere Rotation z.” He also provides an Animation Preset to insert a different set of expressions; see the discussion at the Adobe forums in Interacting 3D elements – CC Sphere and 3D Rotate Around Circle Animation Preset.
 

A longer expression was posted on motion graphics eXchange by Filip Vandueren in Ultimate CC Sphere/Light/Comp Camera linker. Here are the expressions for X, Y & Z-rotation:

“CC Sphere Rotation X:
// change camera & effect names as needed…
campos=thisComp.activeCamera.toWorld([0,0,0]);
planetpos=thisLayer.toWorld(effect(“CC Sphere”)(“Offset”));
x=length([planetpos[0],planetpos[1]], [campos[0],campos[2]]);
y=campos[1]-planetpos[1];
alpha=Math.atan2(y,x)
value+radiansToDegrees(alpha) ;
 
CC Sphere Rotation Y:
// change camera & effect names as needed…
campos=thisComp.activeCamera.toWorld([0,0,0]);
planetpos=thisLayer.toWorld(effect(“CC Sphere”)(“Offset”));
x=campos[0]-planetpos[0];
y=planetpos[1]-campos[2];
beta=Math.atan2(y,x)
value+radiansToDegrees(beta) – 90;
 
CC Sphere Rotation Z:
No expression

And here are the expressions for the light.

Step1: create your lightsource, and make it an adjustment layer, make sure all the planets are above the light-adj., because we want them to be only lit by the CC Sphere plugin, not receive light. If there are other 3d-layers that do need the shading, put them below the adj.-light. You can just pickwhip the light color and light-intensity from the lightsource to the light-settings of CC Sphere.

CC Sphere Light Height
// change camera & light names as needed…
campos=thisComp.activeCamera.toWorld([0,0,0]);
planetpos=thisLayer.toWorld(effect(“CC Sphere”)(“Offset”));
sunpos=thisComp.layer(“Light 1”).toWorld([0,0,0]);
camvector=normalize(campos-planetpos);
sunvector=normalize(sunpos-planetpos);
angle=Math.acos(dot(camvector, sunvector));
100 – (angle/Math.PI)*200

 
CC Sphere Light Direction
// change light name as needed…
thesun=thisComp.layer(“Light 1”);
xy=thisLayer.fromWorld(thesun.position) – effect(“CC Sphere”)(“Offset”);
angle=Math.atan2(xy[1],xy[0]);
radiansToDegrees(angle) + 90;
 

// by Filip Vandueren

Yet another variation was pondered on the Adobe forum, with Rick Gerard providing a solution in Problem CC Sphere in 3D comp with Camera Mouvement.

 

Power Sphere might make things easier. It's a new 3D sphere plug-in from CROSSPHERE Koizum with power controls for elliptic distortion, unfolding, rich shading, self shadowing, reflections, DOF and comp lights and camera. Another script, Create3DShapes by Charles Bordenave, is another matter but provides interesting options. Here's the demo for Power Sphere:

 

If you want to start at the beginning for learning AE's 3D camera, there's general guidance from Chris and Trish Meyer, and from Andrew Devis, among many others. For more, see the AE Help page Adjust a 3D view or move a camera, light, or point of interest.

Exit mobile version