Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 3D corkscrew that i can fly a camera thru

  • 3D corkscrew that i can fly a camera thru

    Posted by Mike Feuer on November 29, 2007 at 3:21 am

    In a nutshell I am flying down into the top of a swirly chocolate shake (still image)… In the shake there is a ‘party’ going on…

    I want to creat a 3D spiral that i can travel down (sort of like thru a tunnel but i’d like a clear ledge where products can sit) along the way there will be products that I will have auto orient toward the camera. The main animation will come from the camera but I don’t know how to create the spiral in good enough 3D to pull off the look.

    I am very well versed in AE and would like to hear anyone/everyones advice on how to make something really cool.

    I know this can be done in Maya but I don’t have the time or budget to go that route…

    I am an expression idiot so please treat me as such…

    I found this expression but have no idea how to apply it… Does it go in the position of a single layer somehow??
    I tried and just get errors 🙁

    diameter = 200;//pixels
    zBegin = -1000;//pixels
    zEnd = 1000;//pixels
    spinRate = 2;//Adjust this until you like it
    beginTime = 0;//seconds
    endTime = 5;//seconds
    //–
    x = diamter * Math.sin(time * spinRate);
    y = diamter * Math.cos(time* spinRate);
    z = linear(time, beginTime, endTime, zBegin, zEnd);
    [x, y, z]

    Mike Clasby replied 18 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Mike Clasby

    November 29, 2007 at 6:42 pm

    The only error I get is because he misspelled diameter in lines 8 and 9 or the expression. Change lines a 8 and 9 to this, and it works;

    x = diameter * Math.sin(time * spinRate);
    y = diameter * Math.cos(time* spinRate);

    You’d want that expression on the camera’s position.

    This is a little hard to control, as it move a distance in z then just spirals in the same spot.

    Colin wrote an expression for a spiral in x and y, I hacked it for z. Put what you want to spiral toward at the “centerPoint”, x and y position, but adjust the z as needed. The camera will spiral along that center point. Here’s Colin’s (hacked) expression:

    //begin expression
    //Expression by Colin Braley then hacked by yikesmikes
    //Modify these first few variables to change the effect

    centerPoint = [360 , 270];
    beginRadius = 25; //pixels
    beginZ = 0;
    endZ = 800; // how far you want the spiral to move over time
    endRadius = 100; //pixels
    startTime = 0; //seconds
    endTime = 3; //seconds
    howManyRings = 3;
    clockwise = false;
    //if you want the spiral to spin the other way make clockwise = false;

    //–
    t = time;
    if( time < startTime ) t = startTime; if( time > endTime )
    t = endTime;
    radius = linear( time , startTime , endTime , beginRadius , endRadius );
    theta = linear( time , startTime , endTime , 0 , (2 * Math.PI ) * howManyRings );
    if( ! clockwise )
    theta *= -1;
    x = radius * Math.cos( theta );
    y = radius * Math.sin( theta );
    z = linear ( time, startTime, endTime, beginZ, endZ);
    //–
    [x , y, z] + centerPoint
    //end expression

    It looks a little complicated but gives you near complete control, start and stop time, distance traveled, number of ring, etc.

    Most people turn the auto-orient off, Select the camera>Right click>Transform>Auto Orient>Off.

    Not to overwhelm you, but many people use Nulls to help control the camera. Here is a link to two great posts on doing that;

    https://forums.creativecow.net/readpost/2/922144

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy