motion graphics eXchange
top

Ultimate CC Sphere/Light/Comp Camera linker

Thumbnail for: Ultimate CC Sphere/Light/Comp Camera linker
Ever wanted to fly around a "CC Sphered" Layer? Linking CC Sphere to a Light and Camera is the way to do it.
After Effects CS3
3D
Expressions

Views: 17197
Permalink
visit |  share this  error? 
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

Effects & Plugins

CC Sphere

Keywords

CC Sphere, Light, Camera

(Min. Version: After Effects CS3, Category: 3D, Type: Expressions)
posted by Dan Johansson on Feb 03, 2010

 

Related topics:

3D Shadows (Video Copilot, No. 71)

Thumbnail for: 3D Shadows (Video Copilot, No. 71)
Cast 3D shadows onto live action footage
Use shadow diffusion and special material options
Tutorials for Visual Effects & Motion Graphics
Free After Effects Tutorials & More Hosted By: Andrew Kramer
After Effects CS3
3D
Video-/Tutorials

Views: 7427
Permalink
posted by MicGyver on Nov 11, 2008

Looking Through Lights

Thumbnail for: Looking Through Lights
In this 3.5 minute video tip John Dickinson shows how you can look through a camera linked to a light.
After Effects 7
Lights
Tips'n Tricks

Views: 2642
Permalink
posted by Indy on Jan 18, 2009

Advanced Extrusion with Shatter

Thumbnail for: Advanced Extrusion with Shatter
This is a fairly simple technique often done poorly. The trick to making the 3D extrusion look as good as possible is in the way you use a custom shape layer and the way you assign textures to the extrusion.
After Effects CS3
3D
Video-/Tutorials

Views: 8363
Permalink
posted by Dan Johansson on Mar 04, 2009


 

 

follow us on http://twitter.com/mgxchangegoogle+get in touch on facebook

 

 

Full length video training series presented by motion graphics industry professionals. Click here to visit Motionworks website!