ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Coordinates 2D to 3D and back 3D to 2D in one expression?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Doctor
Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 11, 2018 at 12:37:06 pm

Hello!

I've created a shiny 3D-tablet(shapes) and it should reflect the floor it sits on.

The floor is actually a shadow-catcher placed by motionmatching the camera movements of the backgroundfootage.

To give the floor some contents that the tablet can reflect I've precomposed the floor and replaced the solid with the original backgroundfootage. Then I gave the floor an Infinite size to fill up the whole scene. And by hand, using the corner-pin-tool, I corrected the perspectif.

Now I've finally got a 3D floor which aligns perfectly with the backgroundfootage. This prevents me of using camera projection, which also affects the 3D-tablet. Or rebuilding the scene with the vanishing point in Photoshop (I'm not allowed to export *.vpe)

However if I move the compositioncamera, I need to adjust corner-pin-tool to correct the perspective. I guess it can be done with expressions to fixate the corner points to the composition corners.

Since its a 2D effect placed on a 3D layer and the corners should match the 2D composition corners. My question is: How to match both 2D coordinates on different 3D layers, with an expression?


Kind regards Mark


Return to posts index

Kalleheikki Kannisto
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 11, 2018 at 8:14:20 pm

That sounds incredibly convoluted. You lost me about half-way through the explanation of how this is set up.

Perhaps the best thing to do here would be to duplicate the layers that make up your 3D object and scale them -100% on the y-axis and offset them on the same axis to create a fake reflection, that you can blur, lower the opacity on, etc...?

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Mark Doctor
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 11, 2018 at 9:22:16 pm

Thank you for your input.

That indeed would fake the reflection of the 3D-tablet into a floor. My curent problem is the fact that the floor isn't reflected by the tablet.

So i needed to create a fake floor from the backgroundfootage to be reflected by the tablet.


Return to posts index


Mark Doctor
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 12, 2018 at 1:41:31 am

Maybe I should put it this way. The backgroundlayer is rotated to Lean backward, to create a floor and I used the corner-point-tool to skew the image so it looks upright again. This works fine when everything remains static

But if i change the camera angle the skewing needs to be altered dynamically to the compositionscornerpoints


Return to posts index

Kalleheikki Kannisto
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 12, 2018 at 4:47:25 am
Last Edited By Kalleheikki Kannisto on Jun 12, 2018 at 4:59:13 am

Ok, I see, I got that backwards. I guess you're using AE's built-in 3D materials options for this?

I don't quite get why you're using corner pin rather than turning the layer into a 3D layer. Perhaps a screenshot of how the scene looks would help.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Mark Doctor
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 12, 2018 at 5:14:35 pm



Thank you for your help. I've taken 4 screenshots:

top-left:
original scene with a 3D-shape.

top-right:
Creating a 3d-layer from the backgroundfootage and turn it 90° to create a floor.

bottom-left:
Skewing the image with the corner-pin-tool, back to its original state.

bottom-right:
New cordinates are needed for the corner-pin-tool, when the camera move's. These need to be pinned down to the compositions corners.


Return to posts index


Kalleheikki Kannisto
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 12, 2018 at 8:29:26 pm

Ok, how about a simpler solution? Make the floor for reflection as a plane, repeating a piece of that wooden floor. Instead of corner pinning to "fix" the perspective, use a copy of the tablet without a background as a track matte to hide the reflection surface and to reveal the original footage.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Mark Doctor
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 13, 2018 at 10:06:04 pm

I Think your right. That means that i need to tile the floor with planks and create massive 3D plate. Then in material options select "appears in reflections only".

Still I have developed the original idea a bit further. Because of the flexibility to automatically acquire the floor of a random footage. I wrote 4 expressions for the cornerpins:

Upper Left: thisLayer.fromCompToSurface([0,0,0])
Upper Right: thisLayer.fromCompToSurface([thisComp.width,0,0])
Lower Left: thisLayer.fromCompToSurface([0,thisComp.height,0])
Lower right: thisLayer.fromCompToSurface([thisComp.width,thisComp.height,0])

They all work fine and I also can use them als a preset for different purposes. But at a certain (steep) angle of the floor the expression gives an error message. Since I can manually drag the point-control to the desired position, I guess its got something to do with the size of the numbers to do the math, but not there outcome.


Return to posts index

Kalleheikki Kannisto
Re: Coordinates 2D to 3D and back 3D to 2D in one expression?
on Jun 14, 2018 at 6:40:10 am

Yes, I think perspective point values are just too extreme for corner pin to counter-act.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]