Holographic tablet

Scripting for After Effects

Holographic tablet

Postby Timber_Wolf_2 on 09/18/2013, 7:36 am

I have an actor at a table, swiping through a holographic tablet. By holographic, I mean that it looks and behaves just like a normal tablet, but the icons and such are raised off the surface of the table, hovering a few inches up.

My difficulty comes in tweaking the look of the holographic aspect. I'd like the buttons and such to raise from table level, to a couple inches up, and back down again as they are scrolled across the screen by the user; I want their path across the tablet interface to be arched -- low on the outsides, high in the middle.

Here's a quick mock-up of what I mean:

3D scroll 1.PNG

3D scroll 2.PNG

Now, I know it's been discussed here and on the COW, but not at length, and I couldn't find something that meets my exact needs, but the Mac OSX Dock effect is close to what I need.

Code: Select all
mouse_layer = thisComp.layer("mouse layer");//Mouse layer
beginScale = 100;//Scale begins at this
endScale = 250;//Scale ends at this
beginDistance = 200;//Distance to begin magnifying in pixels
endDistance = 0;//Distance to end magnifying in pixels
//--Don't modify below here
dis = length(this.position, mouse_layer.position);
val = ease(dis, beginDistance, endDistance, endScale, beginScale);
[val, val]

I want to apply this to z position rather than to scale, but have no idea how. Here's what I worked out:

Code: Select all
Center = thisComp.layer("Position sampler");//Tablet center
beginMove = 0;//Zposition begins at this
endMove = -1000;//Zposition ends at this
beginDistance = 200;//Distance to begin moving in pixels
endDistance = 0;//Distance to end moving in pixels
//--Don't modify below here
dis = length(this.position, Center.position);
val = ease(dis, beginDistance, endDistance, endMove, beginMove);
value+[0,0,val]

I applied this to the animals' position parameter, and it doesn't work.

Can anyone help me refine this code so the z depth changes based on proximity to a null's position?
--
Timber_Wolf_2

Carpe diem pro nomine Christi
Timber_Wolf_2
 
Posts: 925
Joined: 10/11/2011, 11:23 am
Location: Pensacola, FL

Re: Holographic tablet

Postby Timber_Wolf_2 on 09/18/2013, 8:05 am

UPDATE: I should also mention, that I have all my animals parented to a null object to make scrolling easier. I think this is what's killing it, since parenting re-does the position numbers to be relative to the null object, as opposed to absolute values of their position. As soon as I un-parent individual animals from the chain, the expression begins working properly.

So now that I know my expression code works and that it's parenting that destroys the calculations, how do I keyframe my animation so that I can move all my animals globally (instead of keyframing every single animal) making sure they react to their proximity to the center position null)?
--
Timber_Wolf_2

Carpe diem pro nomine Christi
Timber_Wolf_2
 
Posts: 925
Joined: 10/11/2011, 11:23 am
Location: Pensacola, FL

Re: Holographic tablet

Postby Timber_Wolf_2 on 09/18/2013, 8:17 am

UPDATE: I tried linking the animals' position to the mover null's position through expressions instead of through parenting like this:

Code: Select all
Center = thisComp.layer("Position sampler");//Tablet center
beginMove = 0;//Zposition begins at this
endMove = -1000;//Zposition ends at this
beginDistance = 2000;//Distance to begin moving in pixels
endDistance = 0;//Distance to end moving in pixels
//--Don't modify below here
dis = length(this.position, Center.position);
val = ease(dis, beginDistance, endDistance, endMove, beginMove);
value+[thisComp.layer("Animal mover").transform.position[0]-5400,thisComp.layer("Animal mover").transform.position[1]-540,val]

(yes, it says 5400. it's a really wide comp)

And that got the x and y of the animal to move with the mover null, but it somehow broke the ability of the zscale expression to change in proximity to the center position null. It doesn't work.

At the risk of sounding like so many noobs... HELP!!

And that got
--
Timber_Wolf_2

Carpe diem pro nomine Christi
Timber_Wolf_2
 
Posts: 925
Joined: 10/11/2011, 11:23 am
Location: Pensacola, FL

Re: Holographic tablet

Postby graymachine on 09/23/2013, 10:54 pm

Well, lately I am on medication that makes my brain and eyes fuzzy.. but maybe this will help.

If it were me, I'd tall all those animals and parent them to a null. Then in their scale, I'd use:

Code: Select all
a = thisComp.layer("Null 1").toWorld([0,0,0]);
b = thisLayer.toWorld([0,0,0]);
l = length(a,b);
s = ease(l,0, 250, value * 2, value )
[s,s]


Adjust to taste. This makes the scale of the object double as it passes near Null 1 within 250 pixels, either direction.

EDIT: Followed Kevin's suggestion to use world space instead of comp space, because 3D.
Harry Frank
Motion design tutorials, elements and more.
http://www.graymachine.com
graymachine
VC Moderator
VC Moderator
 
Posts: 981
Joined: 08/4/2008, 6:38 pm
Twitter: graymachine

Re: Holographic tablet

Postby Maxweel on 09/24/2013, 1:23 am

Nice idea Harry, hope you're alright too.

Since he's using 3D Nulls ... well ... it doesn't make a huge difference but it would be safer to use toWorld instead of toComp. Otherwise the results may be unexpected with some camera angles.

Also, to make the objects rise a bit, you could add the same ease expression on the anchor point property, on the Z axis given your screenshots. This way you'll get the layers rising without messing up their positions (hence it's not going to affect the expression Harry wrote).
Maxweel
 
Posts: 704
Joined: 03/12/2012, 8:21 am
Location: Ipswich, UK

Re: Holographic tablet

Postby acehole on 03/9/2016, 9:18 am

Hi Greymachine, thanks for posting this! Sorry to revive an old thread, but I am trying to accomplish something quite similar here - and I'm having difficulty with the code you posted. It's giving me the error "array piece can't expand to more than one value" when I try to use it. I've tried figuring this out by searching online, but to no avail.

Any assistance would be appreciated.

graymachine wrote:Well, lately I am on medication that makes my brain and eyes fuzzy.. but maybe this will help.

If it were me, I'd tall all those animals and parent them to a null. Then in their scale, I'd use:

Code: Select all
a = thisComp.layer("Null 1").toWorld([0,0,0]);
b = thisLayer.toWorld([0,0,0]);
l = length(a,b);
s = ease(l,0, 250, value * 2, value )
[s,s]


Adjust to taste. This makes the scale of the object double as it passes near Null 1 within 250 pixels, either direction.

EDIT: Followed Kevin's suggestion to use world space instead of comp space, because 3D.
acehole
 
Posts: 1
Joined: 03/9/2016, 9:13 am
System Specs: 4790k
GTX 980


Return to After Effects Expressions