Colorize the buildings and roofs from its attributes.

6286
17
03-24-2015 12:46 AM
RushikeshPadsala
New Contributor II

Hi there. I have a gdb which contains, Multipatch LOD2 Buildings (in 3D), I have roof surfaces, trees, water and terrain. I want to colorize the Buildings and the roofs with the attributes stored inside it. For buildings, I want to colorize according to building type (Residential, Office etc). The field for landuse type is Land_Type. Similarly I want to color roofs, but all with the same color lets say light brown. Nothing needs to be extruded as everything is already in 3D. Please help me to write the rules, or any examples which has the similar rules. I am completely new to CityEngine. Please help. I use city engine 2014.1.

Thank You.

0 Kudos
17 Replies
RushikeshPadsala
New Contributor II

Yup..thats done. Now I have some new questions:-

1. I have polygons which represent green spaces. I want to texture it as grass. How to do it. I have grass texture file in jpeg.

2. I have certains tree points with attributes as Height, crown diameter and crown width and also name of the tree like Palm, Pine etc with its texture jpeg file. How to convert that into 3D with texture.

3. I have some points which represent street lights. There is no attribute inside it. But I have a texture file in jpeg. I want to get it into 3D.

4. The multipatch buildings are just LOD2 . How to color the roofs and the facades. Since the buildings are one single solid, is it possible to texture facade and color roofs ?. I have texture file of facade which should be same on all facades of the buildings.

Thanx Chris WilkinsMatthias Buehler

0 Kudos
by Anonymous User
Not applicable

Check help file for these operations:

1. setupProjection, projectUV, texture.... knowledge of scope is required. you should learn "inspect model" mode, and the model hierarchy window.

2. make plant image have trunk centered on image. make a cross shape with the image by extruding a box to your desired height and using comp(f) to remove two sides and move them to make a plus sign when seen from above. use what you learned in step one for texturing. this also needs knowledge of scope.

3. instead of using your image, find a 3D model that looks similar from another source such as Trimble Warehouse. Use s(0,0,0) operation to reduce scope to a point. use i() operation to insert model on point. using s(0,0,0) will insert the model in the model's scale as specified in the model. use center(xz) if necessary. make sure the model is at the origin in the model file.

4. use your knowledge of scope from question 1 and combine with this, which in this case can handle roof and facade separately if you choose to:

comp(f) {top: Roof | aslant: Roof | side: Facade}

This is a learning exercise, and beyond the help docs, this is a great resource:

CityEngine Help

0 Kudos
RushikeshPadsala
New Contributor II

Thank You so much for the help. Just when I though everything is going fine I got across to other problems:

1. I am not able to import File Geo Database. Whenever I select my FGDB directory and drag and drop on the viewport suddenly all the counts, projections goes missing. This is not the case when I import shapefiles. I use City Engine 2014.1 (Esri CityEngine 2014.1.1703 (Build Date: 140831, release, win32-64bit)

2. All the attributes in the shapefile as re-arranged as per ascending order in the block attributes. How to stop that, as it will look bad when I share it on web. Is there any option to create alias and also to hide a particular attribute field when sharing it on web. Chris WilkinsMatthias Buehler

0 Kudos
RushikeshPadsala1
New Contributor

Hii,

I have succesfully completed my scene but I have the follwoign problems, any solution aroud...need help as in to give the final touches.

1. I am not able to import File Geo Database. Whenever I select my FGDB directory and drag and drop on the viewport suddenly all the counts, projections goes missing. This is not the case when I import shapefiles. I use City Engine 2014.1 (Esri CityEngine 2014.1.1703 (Build Date: 140831, release, win32-64bit)

2. All the attributes in the shapefile as re-arranged as per ascending order in the block attributes. How to stop that, as it will look bad when I share it on web. Is there any option to create alias and also to hide a particular attribute field when sharing it on web  Chris WilkinsMatthias Buehler

0 Kudos
by Anonymous User
Not applicable

Weird. It looks like your login is different on these double-posts...

1.Can you post a screen capture of the strange effects you describe?

2, I assume there is not a way to avoid the reordering. As for hiding, when you export to web scene, you can choose to hide all rule attributes, and all object attributes, or both. As for hiding individual rule attributes, you can add the @Hidden annotation before the rule attribute in your CGA immediately before exporting, and then remove the notation after export.

0 Kudos
KathrynAngleton
New Contributor III

Hi Matt, is there anyway to expand the color ramp function to more than 5 breaks?

0 Kudos
KathrynAngleton
New Contributor III

Hi Chris,

I have followed your example to a T but with my own qualitative attributes to set colors to, and it says unexpected token on the first case, any idea what's going on?

0 Kudos
DevinLavigne
Occasional Contributor III

you need an equals sign after getColorByCity(NAME)....as in 

getColorByCity(NAME) = 

   case NAME == ......

0 Kudos