Forum Replies Created

  • Erland Kjensli

    November 1, 2007 at 7:05 pm in reply to: A new way to simulate “real 3D” in AE

    I misunderstood what QTVR is a little. But I now have a solution to get the 3D object rendered easily from all angles.

    A guy in the norwegian forum 3Dhue.com suggested a script that could look like this in a template 3DS file: (neither him or I know MAXScript so this is pseudo code)

    Move the camera pivot to the center of the scene/stage and rotate the camera down to -90 degrees (in relation to the ‘floor’), and run a script something like this:

    for (int $i = 0; $i < 180; $i++){ rotate camera one degree 'up'; for (int $j = 0; $j < 360; $j++) rotate camera one degree round 'equator' per frame; next next Anyone here that knows MAXScript and can write something like this? (I guess it's time to move this over to a 3D forum?) When I can use a template like this to render out one movie with all frames needed, and just add the code in AE to the footage, the amount of work that goes into this technique is significantly less than I feared. Actually it's practically nothing, if you don't consider the 3D modelling, which is a separate issue.

  • Erland Kjensli

    October 30, 2007 at 8:29 am in reply to: A new way to simulate “real 3D” in AE

    After my new discovery of QTVR .mov-files this technique will be a breeze.

  • Erland Kjensli

    October 29, 2007 at 4:19 pm in reply to: A new way to simulate “real 3D” in AE

    Sweet! Thank you!

  • Erland Kjensli

    October 29, 2007 at 4:18 pm in reply to: A new way to simulate “real 3D” in AE

    Ah. Thanx!

  • Erland Kjensli

    October 29, 2007 at 7:59 am in reply to: A new way to simulate “real 3D” in AE

    The “Kjenslifying” technique.

    It’s a little comprehensive and takes a some preparation, so you be the judge of the pros and cons of this technique. Additionally, it’s not perfected yet. The expressions need a little tweaking to be perfect. And a lot of the code is hardcoded instead of using several of the intrinsic/native (?) functions of AE. This should be corrected so that it will be easier for people to adapt this to their own footage. If there is something in my project that doesn’t make sense, just mail me and I’ll explain it. Feel free to suggest changes and improvements.

    Here goes. The point is to make a movie clip or a rendered animation that shows a rotation of an object. In many cases it will suffice with one rotation around the Y axis (following the XZ plane). If you make a footage like this, one should do it in front of a green “screen” to key out everything other than the object. Place the object (or person) on something that can rotate (a chair or something) and rotate it 360 degrees while recording. A more exact way to get an even rotation is to create an object in a 3D program like 3D studio max. Animate a rotation round the object, and render it out including the alpha channel. I used PNG-files and imported them as PNG-sequence in AE. The number of PNGs per rotation dictates how smooth the flow will be in the finished effect. I have created one project for rotating just around the Y axis, and one for rotating around all three axis. So when creating for just the Y axis, I used 249 frames (I think) to get the whole rotation.

    First I’ll explain the Y axis only project. I have created 4 “walls” using a stars image 4 times, just to get a little space feeling. So that’s the 4 bottom layers in 3D. Then we have the footage containing the rotated object above those. On top I have the camera layer. All expressions are applied to the rotation footage only.

    I use the “look_at” in the “Orientation”:

    lookAt(position,thisComp.layer(“Camera 1”).transform.position)

    As you know, this makes the footage always face the camera. Then I use Time >> Freeze Frame on the footage. In addition I enable time remapping on it as well.

    I added a Slider Control to the footage, found in the
    Effect >> Expression Controls >> Slider Control.

    I added expressions to this slider control, and it looks something like this:
    ———————————-
    Add= 0;
    Invert = 0;
    Fx = transform.position[0];
    Fz = transform.position[2];
    Cx = thisComp.layer(“Camera 1”).transform.position[0];
    Cz = thisComp.layer(“Camera 1”).transform.position[2];

    if ((Fx == Cx) && (Fz == Cz)) Angle = 0;
    if ((Fx >= Cx) && (Fz > Cz)) {Add = 0; Invert = 1};
    if ((Fx > Cx) && (Fz <= Cz)) {Add = 90; Invert = 0}; if ((Fx <= Cx) && (Fz < Cz)) {Add = 180; Invert = 1}; if ((Fx < Cx) && (Fz >= Cz)) {Add = 270; Invert = 0};

    x = Math.abs(Fx-Cx);
    z = Math.abs(Fz-Cz);

    if ((x != 0) && (z != 0)) {
    Angle = radiansToDegrees(Math.atan(z/x));
    } else {
    Angle = 0;
    }

    if (Invert == 1) {
    TotAngle = Add + (90-Angle);
    } else {
    TotAngle = Add + Angle;
    }

    linear(TotAngle, 0, 360, 0, 10)
    ———————————-

    This computes the angle between the footage position and the camera position on the XZ plane around the Y axis. The inverted TAN function only works from 0 to 90 degrees so I have to make it check which quadrant of the circle it is in, and then add 0, 90, 180 and 270 degrees accordingly.

    The last line (linear) converts the absolute angle to the TIME OF THE FOOTAGE. So 0 to 360 degrees converts to 0 to 10 seconds.

    Then in the Time Remap of the footage I add this expression:

    effect(“Slider Control”)(“Slider”)

    This then gets the time value and shows the correct frame from the footage.

    Voila! 360 degrees rotation around an object in AE. This effect will work mainly if you stay close to the XZ plane and don’t travel too far up or down Y. But in many cases this will be enough for some really cool effects.

    Now for the total rotation. Now it will be a little too complicated to shoot film containing an object shown from 360x360x360 degrees. So I created a rendering in a 3D program of a head rotating 360 degrees XZ as above, only with just 89 frames all around (should have been 90, just a glitch). Then I changed the angle 5 degrees up and rendered again. After up and down I ended up with 360 degree rotation seen from 37 angles. This results in lots of frames.

    You will find the code for this project in a link further down. It’s similar to the first project, but we have to compute the angle between the XZ plane and the camera as well. And then add 89 frames to the footage time for each 5 degrees elevated. Get it? Sorry if this is a little confusing, but download the projects (7MB and 47MB) and take a look.

    It all needs a little cleaning up in there, and a few math functions should be replaced with AE functions.

    Feel free to comment on this or suggest changes and rewrites.

    https://www.tellusdata.no/KjenslifyingXZ.rar
    https://www.tellusdata.no/KjenslifyingXYZ.rar

    Erland Kjensli
    (Alan Chenslee)
    Norway

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