Skip to main content
Known Participant
October 11, 2019
Question

Projecting multiple images in AE?

  • October 11, 2019
  • 5 replies
  • 718 views

Hello. I've projected an image of the outside of a house with an open door onto geometry in AE, in 3D space. The problem is that when I pan the camera too far left or right, rather than showing the inside of the house, the outside of the house is projected onto the inside geometry. 

I've created a separate PS image to use as the inside "room scene", but don't know how to apply it within the project. Is it also projected as a 2nd image, or should it just be a 3D layer tucked in behind the opening in the geometry? If so, that feels pretty clunky - just visually lining up a 3D layer to roughly feel like it's in the background. 

 

Thanks!

    This topic has been closed for replies.

    5 replies

    Community Expert
    October 13, 2019

    If you take a photo of a box from an angle the sides of the box will not be square. Parallel lines on the box will no longer be parallel.

     

    If you isolate one of the sides of the box with a mask then crop it to get rid of the empty pixels, then apply Corner Pin to the image and adjust the corners until the parallel lines are once again parallel, then you make that layer 3D and put it in the same position as the original box using the same camera position and the same camera angle the corner pinned 3D layer will look exactly like the original box but you will be able to move a virtual camera around the scene to get a squared up view of the end of the box you turned into a 3D layer. No distortion.

     

    If you are working with the still image that is in your screenshot I would just open it up in Photoshop, carefully use the Vanishing Point tool to generate a VPE you can open in After Effects. It's a lot less work. The scene you are describing is going to take a lot less time will not require any projections.  Take a look at this tutorial and see if it gives you any ideas. It is pretty good.

    The vanishing point approach is going to be a lot easier than distorting the images in AE and lining them up, but corner pin workflows work just fine. I use them all the time.

     

     

    Known Participant
    October 14, 2019
    Thank you, Rick.
    Community Expert
    October 12, 2019

    You have several workflow problems. I am pretty sure that you are projecting the image of the house onto the left and right walls and just living with the distortion you get. The second problem is that you are using a spotlight instead of a parallel light to create the projection. If you are projecting one image onto a layer and you do not want to distort the image the easiest thing to do is to make sure that the image and the layer are parallel and centered on each other. The layer you are using for projection should be the same size as the layer catching the shadow. Working with a spotlight or a point light will work but it requires that you position the layer somewhere between the light source and the layer catching the image and then scale it to fit. You also do not get as good an image unless you use Ray-traced or C4D rendering and that just slows things down. Use a parallel light Shift + Parent the projections to the layer catching the projection to snap their anchor points and rotation to the same place in AE's 3D world, then with the selection toolset to Local Axis, grab the z-axis and move the projections away from the layer a bit. The distance does not matter, but the projection layer must remain parallel to the layer catching the shadow.  This will make things a lot easier. When the Projections are set up hold down the shift key again and parent the lights to their projection layers then immediately remove the parenting. You can leave it in exactly the same spot if you like because the light source does not spread out.  The last step in setting up the projection is to select the Point of interest for the light, reveal the Position property of the layer catching the projection, and then copy the position and paste it to the point of interest or just set up a simple expression. Now the layer will be projected onto the surface with no distortion.

     

    There are workarounds to use projection and spot or point lights and to project at angles then correct for the distortion, but they are usually a lot more trouble than they are worth.  Once the projection is set up properly you can move the camera anywhere you like and the projected image will not move. 

     

    I'm not sure which layers in your composition are catching the projection.  If it is all of them then the image must have a lot of distortion. If you are projecting on the door, and the door is going to swing open then you have to parent the Parallel light and the projection layer to the door so they move when the door swings. 

     

    From the screenshot I don't understand why you just didn't cut up the image in Photoshop using the Vanishing Point tool or just import the photo and duplicate it several times, then use corner pin + 3D to re-assemble the house using parts of the image. Depending on your source footage this would probably be a lot less work.

     

    So here's the basic layout - just using solids to represent your scene with a projection on each wall of the house, a projection on the front door, and a large image in the back to give you the back wall. I used expressions to tie the light's point of interest to the appropriate walls. Everything is color-coded so you can see the setup:

    If you told me exactly what you were projecting on the geometry I could probably help a bit more. Generally, I think you are making this project a lot more complicated than it needs to be.

     

    Known Participant
    October 13, 2019
    Thanks for the response. If I understand you correctly, you seem to be setting up a separate parallel light & reusing the projection image for each surface. I used 1 projection image (of both walls of house and floor), & a one spotlight. This projects onto 3 3D solids - the floor & both walls (one of which has a mask that "opens" the door, allowing the inner room layer behind it to be seen). I see no distortion to the projected image using this method, but I did need to adjust the wall solids a good bit in 3D space using local axis' to match the perspective of the projected image. The layer of the man in front of the 3D solids that are being projected onto does not cast shadows, does not accept shadows or lights, & has a light transmission of 0%, so it sits in 3D space with the walls, but isn't affected by the projection layer. I will try your method of using parallel lights and projections for each surface. The other thing you mentioned - "import the photo and duplicate it several times, then use corner pin + 3D to re-assemble the house using parts of the image" would seem to cause way more distortion - as I would be taking a flat layer of an image with perspective, then rotating that layer with the image to actually be at the perspective in 3D space.
    Known Participant
    October 11, 2019

     Attached is a screengrab of how I've set up my 3D scene  -  

    - Geometry is a floor & 2 walls (left wall has mask for door opening).

    - Through door opening is the inner room .psd ( extra image overlapped the geometry, so I masked that out).

    - In front of the walls is the kneeling guy layer w/ alpha mask. I discovered that he needed to be very close to the wall layers, rather than part of the projection layer, otherwise, he would move wildly when I pan my camera null. 

    Community Expert
    October 11, 2019

    To upload an image just drag it to the forum and wait, then make it as big as you can by using the tools that pop up when you mouse over the image. You can also use the toolbar at the top. There is nothing to it. You will have to use the top blue Reply button to start your post. The inline posts don't have as many options.

    Known Participant
    October 11, 2019
    Cool! Thanks for the tip - just uploaded below.
    Community Expert
    October 11, 2019

    This is a case where a screenshot showing your 3D setup using multiple views and at least the position properties of the layers would be very helpful. There are at least 20 ways to do something like this that I can think of.  A typical projection setup involves a parallel light with an image in front of it just a little bit with "transmit light" set to 100% and all of the layers lined up with the solid or shape layer that is going to receive the image.  Here's an example:

    The first thing I did was to add a 2 node camera and a couple of comp sized 3D solids to the timeline. One of the solids I named road, added a grid to make it easier to check geometry, rotated 90º in X and adjusted the position and scale, along with the height and point of interest of the camera until I could match the perspective of the road. Then I moved the Wall layer straight back in Z using the timeline property, set the cursor to Local Axis, adjusted the rotation and position until it lined up with the wall on the building and everything looked right. Then I added a parallel light to the scene set to cast shadows and 100% intensity. The next step is to Shift + parent the parallel light to the Wall layer, grab the Z-axis of the light in the top view comp panel and slide it away from the wall. Because it is a paralell light the distance matter. Setting the selection tool to "Local Axis" is important because you want the light to stay parallel and aligned to the surface you are going to use for the projection. Right after that I copied the position property of the wall layer and pasted it to the point of interest of the light so everything would lineup. The next step was to add the projection layer to the timeline, make it 3D and shift parent it to the parallel light to snap it into the correct position. The last step was to set the projection layer to cast shadows only and light transmission of 100%. Everything looks good.

     

    To poke a hole in the wall layer for the door (your window) so anything behind it in 3D space or as a background layer is visible is pretty easy. Just add a shape layer using the Layer>New>Shape layer menu, make it 3D, shift + parent to the Wall layer to snap the layer into position, make sure the track matte layer is directly above the wall layer, then use the pen tool to draw a filled shape around the opening you want to make. Set the new shape layer as an Alpha Track matte for the Wall layer and you're done.  

    Known Participant
    October 11, 2019
    Thanks Rick! What you've done here makes sense to me. I have a screen grab of what I'm doing - how do I go about uploading it?