Code Monkey home page Code Monkey logo

blendercity's Introduction

BlenderCity

A small random generator of city models in Blender via bpy

The code generates a city (lots of resized cubes) such that small buildings "grow" towards the center and the skyscrapers just spawn randomly in the middle

Here are the variables:

  • roadlen1 - the length of two main roads. It is also a diameter of a circle

  • elevationcoef - growth coefficient of small buildings

  • houseconstant - constant to lower/lif all the houses at once

  • roadwidth1 - width of the main roads. recommended to use even numbers

Secondary always have one end in a main road

  • MINroadlen2
  • MAXroadlen2 - minimal and maximal length of secondary roads
  • roadwidth2 - width of secondary roads
  • roadgap2 - minimum distance between two collinear secondary roads
  • roadsection2 - multiplied by roadgap2 is maximum distance from center
  • axialroads2 - amount of roads on an axis (roads can overlap, so it is a maximal possible amount)

Tertiary roads always start and end in one halfplane

  • MINstartlen3

  • MAXstartlen3 - minimum and maximum distance from closest end to the main road

  • MINendlen3

  • MAXendlen3 - minimum and maximum distance from furthest end to the main road

  • roadwidth3

  • roadgap3

  • roadsection3

  • axialroads3 - same as for secondary roads

  • roofchance - chance of getting triangle roof on top of house

  • divcoef - randomness coefficient of small building

  • radius - radius of circle where skyscrapers can spawn

  • MINdim

  • MAXdim - minimum and maximum dimensions of skyscrapers

  • MINheight

  • MAXheight - minimum and maximum heights of skyscrapers. multiplied by two in the code (ie MAXheight=10 will spawn building with height up to 20)

  • MINvert

  • MAXvert - minimum and maximum amount of vertices of skyscrapers

  • amount - amont of skyscrapers to be spawned (note that two shyskrapers can spawn in one place and look like one)

blendercity's People

Contributors

dkozl50 avatar eclissi91 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.