Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change objects in a sphere to show the back face

  • Change objects in a sphere to show the back face

    Posted by David Cabestany on April 28, 2016 at 10:09 pm

    I made a comp that has the front and back of a credit card within, in 3D space so if you rotate the comp you truly see the back of the card.
    Then I created a sphere by duplicating the comp a few hundred times and applying the the expressions below.

    The sphere works ok, except that all I can see is the front, considering that I have a null in the center of the sphere is there a way to modify this expression to have the back of each comp facing inward and the front outward as it would be in real life? Something like the opposite of lookAt?

    The null in the center is the layer named controller.

    Thanks,
    D.

    For position:

    L = thisComp.layer("Controller");
    r = L.effect("Radius")(1);
    r * value;

    For orientation:

    lookAt(position, thisComp.layer("Controller").anchorPoint);

    David Cabestany replied 10 years, 4 months ago 5 Members · 18 Replies
  • 18 Replies
  • Dan Ebberts

    April 28, 2016 at 11:33 pm

    If you just switch the order of the two lookAt() parameters, it should orient the other way.

    Dan

  • David Cabestany

    April 29, 2016 at 12:15 am

    Hey Dan, thanks for getting back to me.

    Unfortunately that didn’t do it. It just reversed the orientation of all layers, so the ones that were looking ok before are showing flipped and viceversa.

    The strange thing is when I look at a single layer by soloing it, then I can see the back of the comp as I would expect.

    Best,
    D.

  • Dan Ebberts

    April 29, 2016 at 12:24 am

    Are the layers parented to the null at the center?

    If so, try it this way:

    C = thisComp.layer(“Controller”);
    lookAt(toWorld(anchorPoint), C.toWorld(C.anchorPoint));

    Dan

  • David Cabestany

    April 29, 2016 at 12:32 am

    Yes they are, but sadly that didn’t work either.
    They al changed the orientation, but in a weird way.

    Best,
    D.

  • Dan Ebberts

    April 29, 2016 at 3:49 am

    Just for fun, try this:

    v = fromWorldVec(toWorld(anchorPoint) – parent.toWorld(parent.anchorPoint));
    lookAt(position,position+v)

    Dan

  • Claude Rozsa

    April 29, 2016 at 3:55 am

    Hi David,
    I’m not sure I understand what you wish to do, but I was wondering if part of your problem was not similar to this one explained on the videocopilot site which solution was actually given by a member of Creative Cow. Here is a the link to Andrew Kramer’s tutorial:
    https://www.videocopilot.net/tutorials/the_blue_planet_in_3d/

    Claude

  • Richard Herd

    April 29, 2016 at 6:09 pm

    Maybe?…nulls are weird because their anchor point is 0,0,0 but their position is 960,540,0 (for example), and solids and every other layer is anchor point 960,540,0 and position is also 960,540,0. Is the expression calculating lookat…anchorPoint as 0,0,0 while all the other layers are different? What happens if you change your null to a solid and set opacity to zero?

  • Kalleheikki Kannisto

    April 29, 2016 at 7:37 pm

    I suspect it has something to do with the way you’ve set up the two-sided card. Are you using collapse transformations for the precomps in the main comp? It appears that the top layer of your precomp always ends up as the top layer in the main comp. You don’t see the back side of any card.

    I think you need an expression that hides or shows the card face depending on which side of the center null the card is on. Or depending on which direction it is facing in relation to the camera.

    Or to make life easier, do this with C4D, Element 3D or Form instead.

  • David Cabestany

    April 30, 2016 at 10:21 pm

    Hey Dan,

    I jumped into another project for the past couple days and hadn’t had the chance to try this. So sorry about that. Much to my chagrin I’m stuck in the office this weekend so I have the time to work on this again.

    Here’s what happened:


    This new expression works, but only if applied to one of the layers (the first on the group) I left all the remaining 115 with the original expression.
    If I apply the expression to every card layer then I get the opposite effect (backs facing me with the fronts pointing toward the null).

    In any case, when looking at the layer in the outer comp it still looks wrong, only the faces are showing. Because of the position of my layer in the outer comp, I must have collapsed transformations enabled, but even if I turn it off just to check, the cards are still facing all front.

    Kalle, because of what I need to do with this cards I think it’s easier to use this method instead of C4D or Element, but I appreciate the suggestion.

    Claude, Thanks for sharing the tutorial. In fact it was Dan who provided that solution, but that technique relies on a fake sphere made by the CC Sphere plug in, due to the camera motion I have I need my layers to have actual 3D coordinates.

    Richard, I replaced the null with a solid and it made a huge mess, no idea why. But thanks for the suggestion, it actually makes sense on paper.

    Anyway, perhaps is not meant to be done?

    Thanks everyone for chipping in.

  • David Cabestany

    April 30, 2016 at 10:28 pm

    Also, I just noticed one thing, the backs only show if I scale the radius of the sphere way down, otherwise it still shows the fronts only, that’s why in my outer comp it was showing only faces. It had nothing to do with the collapsed transformations.

    Anyway, her’s a link to the file, if anyone wants to check it out:

    https://dl.dropboxusercontent.com/u/35786640/esfera%20tarjetas/VIDS_esfera%20tarjetas.aep

    Best,
    D.

Page 1 of 2

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