I have a .shp file with buildings represented as polygons.

Top view


My goal is that, in a 3D representation, I am able to have different colors in a single polygon (building) depending on its height. For example, from 0 to 10 meters, buildings are yellow, then from 10 to 20 m they are blue, and so on.
Is there any way of doing this in QGIS or using PyQGIS? I have tried to add copies of the buildings to the shapefile with different heights and the number of copies depends on the height of the building, and then pick a different color for each building copy, but it does not work, still only one color appears.

EDIT: This is an exemplification of what I'm looking for: Example

EDIT2: Using the Properties > 3D View > Rule-based, and then View > New 3D Map View, I get a 2D map :( : new 3d map view

  • 3
    We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works. Thanks.
    – PolyGeo
    Jan 6, 2020 at 10:37

1 Answer 1


You can achieve this by setting rule based 3d rendering. Navigate to Properties > 3D View > Rule-based and create your own rules and styling.

I did this really quick crude example:

enter image description here

enter image description here

  • How do you visualize the 3D map?
    – rocker996
    Jan 6, 2020 at 16:31
  • In QGIS go to View > New 3D Map View
    – AWGIS
    Jan 6, 2020 at 16:40
  • Doesn't work for me, it still shows in 2D
    – rocker996
    Jan 6, 2020 at 17:17
  • What version of QGIS are you using and can you show a screenshot of the 3D view
    – AWGIS
    Jan 7, 2020 at 9:05
  • I'm using QGIS 3.6.3
    – rocker996
    Jan 7, 2020 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.