There is some great imagery submitted by our users on the Project Galileo Photo Gallery that includes Street Styles decorated with trees and lamps. Currently objects like trees and lamps may not be edited directly in the Street Style editor though they may be easily altered to include 3D models that come with Project Galileo or 3D models that you have added to your Model Catalogues. Keep in mind that street decoration is for visualization purposes only. Trees added as street decorations will not appear in the Trees table, so reporting on them is not possible.
In this post I’ll show you how to update a Street Style to place 3D models as decorations. The Boulevard Street Style that is included with Project Galileo includes three 3D models that enhance the realism of the street itself: palm trees, a round tree base, and street lamps.
Let's say that I wanted to replace the tree species, and use a different street lamp that overhangs the street. In order to do this I need to find 3D models in the Models tab of the Project Galileo Style Palette. I am going to choose a Pinus Pinaster tree from the Vegetation 3D Models Catlog, and overhanging Street Lamp.
Locate the Street Style XML File
- Navigate to your City Models directory where your Project Galileo models are stored. I am using Tiny Town as an example, and my City Models are stored in my Windows default My Documents Directory.
- Open _styles_street.xml file in Notepad or any text editor by navigating in Windows Explorer to City Models --> YourCity.files directory (in my case TinyTown.files) --> styles directory. There you will find _styles_street.xml.
Change the tree type to Pinus Pinaster
Within the Street Style, each "Bucket" may contain various tracks for different aspects of a street such as curbs, greenspace, medians, emergency lanes, and sidewalks. This will depend upon how you design the street. The Boulevard style has definition for median bucket, and for the right lane bucket (Streets are symmetrical for the current release so altering the left bucket will have no effect). Any 3D model such as a tree is added to the XML definition as a decoration. A "decoration" is associated with a track. Keep in mind that the track numbers would start with zero, so if your bucket has three tracks they will be numbered 0, 1, 2.
- With _styles_street.xml open, look for the style with ID of "STREET_STYLE_0" and Name of "Boulevard". Note: you can create a copy of this style by choosing the opening to closing XML <StreetStyle> tags, and changing the <ID> and <Name> for the new/copied Boulevard Style. (See the image above).
- Look for the for the current tree decoration, which is "Vegetation_3D_Models:Tree_Alexandrae". The "Vegetation_3D_Models" is a reference to the Style Catalog containing the tree models, and the "Tree_Alexandrae" is the ID of that models style definition.
- You'll need to find the ID for Pinus Pinaster. To do this, open the XML file for the Vegetation Styles. The file name is _styles_instanced_models_vegetation.xml and it is in the same location as the Street Style XML file.
- Search the Vegetation Style Catalog for the tree "Pinus Pinaster". Once you have found this Style, copy the ID "Tree_Pinus_pinaster".
- Back in the Street Style for Boulevard replace the Tree_Alexandrae" with "Tree_Pinus_pinaster"
Applying the Change
- Save the changes to the _street_styles.xml file.
- Close Project Galileo - the Styles are stored in memory so you have to close and restart the application to see your changes.
- Reopen Project Galileo
- Navigate to the road on which you want the style applied and drag and drop the style from the Style Palette onto the road.
There are several additional variables that may be applied to any track decoration.
- offsetX - Adjusts the position of the model relative to its left edge. So if you want to place a lampost model in the middle of a 2 meter wide greenspace, use an offsetX of 1 meter. Or just 1 here. Note, you may use a negative number here as well to place the model to the left of the left edge of the track.
- offsetY - Adjusts the position of the model forward and back along the left edge of the model, or in conjunction with offsetX.
- transformationMatrix - additional alignment of the model with the road direction (use "-1 0 0 0 0 -1 0 0 0 0 1 0 0 0 0 1" for a 180 degree rotation; leave it blank for no rotation; use "0 1 0 0 -1 0 0 0 0 0 1 0 0 0 0 1"; and "0 -1 0 0 1 0 0 0 0 0 1 0 0 0 0 1" for 90 degree and 270 degree rotations)
- spacing: gap between 2 instances along the road in meters.
- category: the category of the instanced models (currently unused).
- relativeToTrack - the decorations are associated with the left-hand side of a track and the corresponding track index is given here (starting at 0 as noted above).
Finally, I replaced the deocoration for the street lamp. The street lamp is located in the greenspace track of the "RightBucket" with a new street lamp model found in the City Furniture 3D model catalog: _styles_instanced_models_city_furniture.xml. Changing the reference from "City_Furniture:Street_Light_1_Bulb" to "City_Furniture:Light_Street_Lamp" will use a different street lamp. Note: I also used the tranformationMatrix settings for 180 degree rotation above for this decoration.
Keep in mind that you may place as many models as you like per track. You could place cars on the street, people on the sidewalk, or whatever you can think of and have models for.
Note:Models included in the Project Galileo Style Palette may also be duplicated if you would like to adjust scaling. But more on that later...