Project city buildings onto terrain landscape?

I’m trying to make some quick and dirty city examples with rough textures for distant viewing (like the top portion of the attached image). I’m grabbing buildings from OSM and generating landscapes within Blender.

I’d love to “drop” the buildings or project them onto uneven terrain quickly. They’re Ctrl+J joined and extruded as polygons and textured en masse. The end result is for fast flyovers or distant bird’s eye views, so details aren’t crucial. In the attached images, I would love to drop the buildings on the base of the mountains to form the appearance of a waterfront village and dock. Now, the mountain slopes just eat the buildings and there’s hundreds of them.

This will eventually become a WIP or Sketchbook entry, but for now, it’s a model support question! :slight_smile:

Attachments


The OSM data creates the origin for all objects at the center of all the Imported objects. If you make a group of any geometry, you can scatter that group on another object with Particles > Hair : Dupli Group x, and then by checking Whole Group, your group is intact for the shape of it, not scattered at all randomly.

The OSM data can be grouped and then all the Origins set to their individual geometry. BUT when the Whole Group is checked, the particle ignores the individual origins and sets the whole group on a Face balancing it on its center - previously the center of all the Imported Objects. This is annoying - it means that the Z-axis of each individual object in the group will be ignored and, in this case, it’s no way to scatter the city AND preserve the layout of the buildings.

Just thought I’d post a fail. Can we Skin a Group to do this?

Attachments


Ok, this moves to WIP tomorrow or sometime. OSM data to contour against terrain that is not laser-flat requires the Shrinkwrap Modifier. It’s pretty much that easy, but here are some details.

Import an OSM datum with the add-on. It’s just single-layer polygon faces. Place it over terrain - this requires scaling and rotating and little amounts of tweaking to ensure the buildings land where you want them on the terrain.

Additionally, you can use a screen grab to guide your placement. UV the terrain from Top in Orthographic and roughly pinpoint the lakes or squares or traffic circles where you think they’ll look good. In Orthographic Top Viewport, tweak your OSM data to match. With the OSM selected, apply the Shrinkwrap Modifier and use the terrain as the Target.

There are several methods to tweak and I found that the OSM data flipped some normals upside down - it’s good to address that now by Projecting the Negative OR Positive and then in Edit Mode, selecting the Faces that didn’t Project and Flipping their Normals. It takes about three seconds.

Once your placement is set, consider your heights, Apply the Modifier if you’re reasonably sure of things and Extrude to begin the next bit of the process.

The bottom image is the screen grab applied as Top Ortho UV AFTER placing the buildings - so it’s off and uneven in some spots. This gave me the idea to recommend doing it BEFORE placing the buildings; for better accuracy. That screen grab can help to mix grasses, paths, dirt, scatter rocks and materials, etc.

Attachments


Hey nice discovery!
I follow and have read the the other part of the article connected to this theme.
Could you share please your way step by step, creating such a scenario.

I’ve made some tests, to find the most optimized way, but there is no such a way… for Blender, unfortunately 1-2 steps like in 3D max.
What I’m doing as steps,

  1. Create a complex mesh (landscape), with right normal directions
  2. Use array + curve to create the path + additional shrink wrap only for the curve. …
    • additional shrink wrap - projection for the path attached on ground surface
  3. Apply all things, then extrude mesh or use solidify… However I think this is very complicated way. I believe there should be a way to transport all different pieces and object from top view to the surface normals some how… without particle systems and so one…
    What do you think about it from your experience, is there any simple way?


Thanks in advance

Top view, snap to faces ON, snap during transform ON (magnet), project individual elements on the surface of other objects ON.
Select building faces and G, every vertices will be snapped to the mountain.

Thanks a lot! Well I believe this is a better solution… I think.
Well I’ve try to install it but looks like not updated for 2.74

Thanks a lot JuhaW I will try it!

http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Drop_to_ground

I’ve tried your suggested method JuhaW, and it works!!! Thanks
The only one problem during that process is to change pivot point from center to bottom of all group by joining and separating them, well. To resolved this issue, I’m positioning the basic faces first, and then after this step is approved as final, I extrude them how I want… as one joined mesh.

Just returning to Blender again. Can you post a work you’ve done with this?

You can use advanced align addon to change all selected objects origin (its not the same than pivot) points to bottom.

Shrink wrapping just the bases lets them follow the contour of the landscape which will provide more accurate texturing for multiple “hero” buildings. If they’re all 90-degree edges, you’ll not know which are on hills.

From the bases, extrude the group then randomly deselect individual faces and Grab Z to create different heights. Or select from Top Ortho to make heights for a city center. Hero buildings unwrapped will reveal their relation to the terrain.