Wednesday, August 4, 2010

Some Updates

I talked to Ben about randomizing lots, and he introduced me to stochastic rules in CityEngine, which creates variation in lots using randomness. One example (take from the CE help page) would look like:

Lot -->
30% : Lot("residential")
20% : Lot("retail")
else : Lot("industrial")

Currently I'm using another method to randomly generate structures on a lot. It's "get" function that returns different file paths at different probabilities. See the following:

getBuilding =
20%: "assets/shack1.obj"
30%: "assets/shack2.obj"
20%: "assets/shack3.obj"
else: "assets/shack4.obj"

For now I find this easier than the previous method since it doesn't require me to define a new symbol for each possibility. I'll probably use it when I need a lot to develop into different types of procedurally generated buildings (Right now a majority of them are OBJ's...I cheated a little).

I also inserted vegetation into the city. It's funny how much of a differences trees make.


Trees added without wireframes (since they tend to make the leaf-clusters look black)






















Now with wireframes (just for comparison)





















City view. The shadows really slowed the computer down. They look nice, though.





















Also met with Joe, Norm, and Ben today. For now I'll be working mostly under Ben. For his city he wanted procedurally generated buildings (as opposed to OBJ's), since that method would allow us to identify doors on a building. We will be starting with roughly 5 types of buildings: Home, School, Inns, Food/Convenience Stores, and Restaurants. A high level of detail isn't required this time, so most of the architecture will be very basic.

Also working on the slides at the moment. Since I'm posting here already, I might as well include the pictures I'll show on the slides.

Street network generated in CityEngine via Open Street Map file (of Basra)























Lots generated from the street network
























Sidewalks and roads are added.

























By golly do I love blogger's editor. I feel like I'm being spoiled.

Monday, August 2, 2010

Back to work

SAAST just ended, so I'm back at the SIG Lab. Decided today would be a good day to start keeping track of what I do (should have really started earlier, oh well)

Recap so far:
Created a scalable shack that generates additional garage doors at different positions depending on how wide the shack is.


Maya model imported into CityEngine:




Planning out the city:
One of the problems I've been thinking about was how to specify which lot contained what building. One of the potential ideas that came up was to create a variable that generated a building number randomly, and grow the lot from that. Something like:

//ATTRIBUTES//
attr building_type = rand(1,10) //we have 10 building styles here

//RULES//
Lot -->
case building_type == 1: Shack1
case building_type == 2: Shack2
...
else: Generic_building

Unfortunately, nothing happened when I tried running the above code. The next idea I tried was to filter the type of structure generated by the scopes of the lot sizes. Currently, if the x-scope and z-scope differ no more than 1, then a shack-structure will be created from the Lot. If either scope is smaller than 20, then a generic building will be created from that Lot. Although this system isn't very sophisticated, it does do the job of partitioning different lots for different structures. More changes may be implemented in the future.