Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions using 3D objects in AE without plugins

  • using 3D objects in AE without plugins

    Posted by Basilisk on September 26, 2005 at 7:53 pm

    Strictly speaking this is not possible, but there is a limited and approximate way that might be useful in certain scenarios.
    This allows the AE camera to move round the object and view it from different angles, though in this case the camera is limited to the horizontal plane (a small amount of vertical movement might be OK)
    I am indebted to expressions guru Dan Ebberts for helping me crack the code to get this working correctly.

    The trick is to render the object as if on a turntable – render a complete revolution (with alpha channel)
    Import the render, and make it a 3D layer.
    Write a script that calculates the angle between the camera and the object
    Using timeRemap, target the frame in which the object appears to face the camera.
    The layer can be auto oriented towards the camera, but it is better to use an expression (very similar to the first one) to orient the layer, so that it only rotates on the Y axis.

    You can download the files here
    https://basilisk.co.uk/motiongraphics/CCow_3DobjectInAE.zip

    This is the science bit…
    ======================
    revTime = 7.2; //time for 1 revolution of object (seconds)
    v = position – thisComp.layer(“Camera 1”).toWorld([0,0,0]); // v is the vector between the object and camera
    a = radiansToDegrees(Math.atan2(v[0], v[2]));// arctangent works out the angle from the x axis of point (x,y)
    if(a < 0){ a = a+360 }//arctangent ranges from -180 to 180 degrees, so it needs this line to make it 0 to 360 linear(a,0,360,0,revTime)// this maps the 0 to 360 range to the length of the clip ====================== The other option with this technique is to video an object rotating on a turntable against a greenscreen. I am planning to try this and will post results when I have some.

    Basilisk replied 20 years, 5 months ago 4 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    September 26, 2005 at 9:00 pm

    Very nice! Thanks for sharing.

    Dan

  • Yoondo

    September 27, 2005 at 1:12 am

    Hey, this is real cool stuff. I love this sort of 3d simulation thing although the expression is way over my abilities.

    Thanks for the aep.

  • Andy Stokes

    December 12, 2005 at 7:31 am

    Hi all,

    Thx for the great response + the .aep.. I have substituted the 3D figure for a camera I had shot on a turntable.. It works pretty well. One thing I wonder, is there a way to substitute the “revTime=”(manually insert time in seconds) for something that would automatically insert the acurate duration of the source object comp ? For example, my source comp with one full rotation is 2:13 duration (PAL 25fps), this roughly comverts to 2.55 actual seconds. It would be great if the expression could calculate the source’s length ? Any ideas ?

    Cheers,
    Andy

  • Basilisk

    December 12, 2005 at 11:13 pm

    You probably need Dan Ebberts on this one. You can calculate the duration of a layer from layer.outPoint – layer.inPoint, but this is no use when you are using time remapping, to extend the duration of the layer.

    I would love to see the result of your experiment (or at least a quicky test with real footage). I didn’t get to make the music video I was planning to use this in, and it would be good to see how effective it is.

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