# Buildings Projected to Terrain - Lattice and ShrinkWrap - bypassing the terrain and deforming the roof

I'm trying to project many buildings or many shapes into a very uneven Terrain.

I've tried many ways, the closest where to use: only ShrinkWrap constrain, and the best is to use a combination of Lattice modifier and ShrinkWrap modifier.

Most of the times the problem is that the buildings go thru the terrain, some more than others. I would like them to all just sink a little bit.

The other issue is that the roof gets deformed to follow the angle of the terrain mesh.

In my example, the red building is higher. and if you look underneeth half of the building is under ground.

And all the roofs are flat, and as you can see some get an inclination ( deformation ).

Here is the file and a photo:

[![enter image description here][1]][1]

[EDIT] The problem I get with the suggestions (which I read many times), is that the lattice ( yes, I moved it up and down, under the buildings, scaled it, ... ) but it doesn't adapt to the mountain. For you to understand see next new image, showing the bottom of the mountain: the buildings are underneath the mountain, and they don't even show on top of the mountain.

Set the lattice so that is at the bottom of the buildings.

To prevent the deformation on top of the buildings generate a vertex group, and assign only the bottom vertices of your buildings to it.

Then use that vertex group for the lattice. That way only the vertices on the group will be affected by the modifier.

• Wow, @Cegaton, very well explained, but I don't see any ShrinkWrap. For some reason it doesn't work when I do it. I uploaded a new file with your suggestions. but I had to put a ShrinkWrap for it to adapt to the mesh. and still is distorting the buildings. could you take a look? Something else I though, is that the lattice only allows a maximum subdivision of 64. So, for this little example it might work, but when I have the entire city, it will not be sufficient. what do you think? I'm using Open-Street-Maps. Apr 16, 2017 at 22:51
• The shrinkwrap is applied to the lattice
– user1853
Apr 16, 2017 at 23:14
• @sebseb please read the answer carefully: you created a vertex group but didn't assign the bottom vertices. On the shrinkwrap modifier you need to use project mode and select negative Z see the image added to the answer.
– user1853
Apr 17, 2017 at 3:23
• thanks again. yes I forgot to assign the Vertex Group. Now I understand a bit better how it works. I uploaded a new file with your comments. 2 things: 1) the ShrinkWrap doesn't adapt to the mountain, so the buildings are inside the mountain and 2) using the bottom Vertex group the buildings get distorted vertically. The later doesn't bother me too much, although they strech a lot, and go under the terrain a lot which will affect the textures ( the shops under the buildings ). I just don't see a way to tell the ShrinkWrap to adapt exactly to the Terrain. The Offset is 0, so that should be it,no Apr 17, 2017 at 10:42
• @sebseb again please read the answer. The second paragraph and the first picture. Now look at your file i.stack.imgur.com/5BrKi.png. If you put the lattice over the geometry it will push it down past the terrain. I can't help you if you don't read the answer or do something different. Good luck on your project.
– user1853
Apr 17, 2017 at 13:57