Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3,416 changes: 3,416 additions & 0 deletions Build10_obj.obj

Large diffs are not rendered by default.

2,140 changes: 2,140 additions & 0 deletions Build11_obj.obj

Large diffs are not rendered by default.

68 changes: 26 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,29 @@

# Project 4: Shape Grammar

For this assignment you'll be building directly off of Project 3. To make things easier to keep track of, please fork and clone this repository [https://github.com/CIS700-Procedural-Graphics/Project4-Shape-Grammar](https://github.com/CIS700-Procedural-Graphics/Project4-Shape-Grammar) and copy your Project 3 code to start.

**Goal:** to model an urban environment using a shape grammar.

**Note:** We’re well aware that a nice-looking procedural city is a lot of work for a single week. Focus on designing a nice building grammar. The city layout strategies outlined in class (the extended l-systems) are complex and not expected. We will be satisfied with something reasonably simple, just not a uniform grid!

## Symbol Node (5 points)
Modify your symbol node class to include attributes necessary for rendering, such as
- Associated geometry instance
- Position
- Scale
- Anything else you may need

## Grammar design (55 points)
- Design at least five shape grammar rules for producing procedural buildings. Your buildings should vary in geometry and decorative features (beyond just differently-scaled cubes!). At least some of your rules should create child geometry that is in some way dependent on its parent’s state. (20 points)
- Eg. A building may be subdivided along the x, y, or z axis into two smaller buildings
- Some of your rules must be designed to use some property about its location. (10 points)
- Your grammar should have some element of variation so your buildings are non-deterministic. Eg. your buildings sometimes subdivide along the x axis, and sometimes the y. (10 points)
- Write a renderer that will interpret the results of your shape grammar parser and adds the appropriate geometry to your scene for each symbol in your set. (10 points)

## Create a city (30 points)
- Add a ground plane or some other base terrain to your scene (0 points, come on now)
- Using any strategy you’d like, procedurally generate features that demarcate your city into different areas in an interesting and plausible way (Just a uniform grid is neither interesting nor plausible). (20 points)
- Suggestions: roads, rivers, lakes, parks, high-population density
- Note, these features don’t have to be directly visible, like high-population density, but they should somehow be visible in the appearance or arrangement of your buildings. Eg. High population density is more likely to generate taller buildings
- Generate buildings throughout your city, using information about your city’s features. Color your buildings with a method that uses some aspect of its state. Eg. Color buildings by height, by population density, by number of rules used to generate it. (5 points)
- Document your grammar rules and general approach in the readme. (5 points)
- ???
- Profit.

## Make it interesting (10)
Experiment! Make your city a work of art.


## Warnings:
You can very easily blow up three.js with this assignment. With a very simple grammar, our medium quality machine was able to handle 100 buildings with 6 generations each, but be careful if you’re doing this all CPU-side.

## Suggestions for the overachievers:
Go for a very high level of decorative detail!
Place buildings with a strategy such that buildings have doors and windows that are always accessible.
Generate buildings with coherent interiors
If dividing your city into lots, generate odd-shaped lots and create building meshes that match their shape ie. rather than working with cubes, extrude upwards from the building footprints you find to generate a starting mesh to subdivide rather than starting with platonic geometry.
I wanted to go for a city in the nighttime, so I used outlines that sort of represent how a city is lit at night.
I tackled this project by first creating my rules against cubes. I then loaded two building OBJs and had to figure out their scale against a unit cube and adjust them so they still worked with the rules I created.

## Grammar Design
I made six rules:
Stack: C-> AA, creates two stacks of buildings that further subdivide in the top and bottom
Base, Bridge, or Normal Building: D->AEEE, D->C, D-> AEA, E is a terminal shape, that either represents the bridges or the base of a building. D nondeterministicly determines which result to produce.
Subdivide: A->AB, B->A This is the recursive subdividing of the left and half of the shape. It randomly determines which of two building meshes to use as its geometry.

My rules use the location to determine the placement of the subdivided components. The location is also passed to a noise function, which determines the height that is calculated for the rules.

## Building Results
![](https://raw.githubusercontent.com/emily-vo/Project4-Shape-Grammar/master/images/buildingtype1.png)
![](https://raw.githubusercontent.com/emily-vo/Project4-Shape-Grammar/master/images/buildingtype2.png)
![](https://raw.githubusercontent.com/emily-vo/Project4-Shape-Grammar/master/images/buildingtype3.png)

## City Planning
I used a noise function to simulate population density. I then tested at each vertex of a plane if the 3D noise value is greater than some threshold. If the noise is high enough, the building is created. You can also see in the skyline that the noise also dictates the height of the buildings generated.
THe buildings are colored some shade of blue based on the length of the grammar of the buildings.


## Skyline
![](https://raw.githubusercontent.com/emily-vo/Project4-Shape-Grammar/master/Skyline.png)

## Layout
![](https://raw.githubusercontent.com/emily-vo/Project4-Shape-Grammar/master/images/noisygrid.png)
Binary file added Skyline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading