Hello GeoNet,
I have 3D buildings modeled in CityEngine. I created a heat map of office locations and would like to drape the raster of that map over the 3D buildings to show where the concentrations of offices are. This would be much quicker than writing a rule file to color gradient the buildings in my opinion because the geospatial component of office clusters is spread across the raster whereas coloring the buildings would lose the spatial component. Any ideas on how to get a raster over a non-terrain 3D model?
Thanks
Hi Nicholas,
This is how:
- you find the terrain extent in the inspector (select the terrain layer), edit the values in the code below.
- your heat map needs exactly the same extent as the satellite picture with this method.
- this code runs metric, maybe some things need to be adapted for feet projections.
CODE:
****************************************************
terrainExtentData(data) = case data == "SX" : 15000 case data == "SZ" : 15000 case data == "OX" : 3224458.982 case data == "OZ" : -5016876.625 else : 1
ProjectGeorefImage --> setupProjection(0,world.xz, terrainExtentData("SX"), -terrainExtentData("SZ"), terrainExtentData("OX"), terrainExtentData("OZ") ) projectUV(0) texture("maps/myMap.jpg")
*****************************************************
Cheers!
matt
------------------------------------------------------------------------------------------------------------------matthias buehler || ceo & co-founder || msc. arch. eth zurich ------------------------------------------------------------------------------------------------------------------vrbn AG – official esri partner || www.vrbn.io || winterthurerstrasse 53 || 8610 uster || switzerland +41 78 930 04 07 || matthias.buehler@vrbn.io || @vrbnio @mattb3d
Thanks Matthias,
It took a few moments to realize this would be a rule applied to the buildings rather than the terrain. I got it to work, but forgot that rasters default white to black in CE. How can I change the color ramp on the raster?
Check the bottom section
setupProjection operation—Esri CityEngine | ArcGIS Desktop
Hi ..
it will work .. 😉
the workflow has nothing to do with the terrain per se. you just use a georeferenced terrain to get the proper extent values for a heat map, which gets projected onto the models via CGA.
CGA does not know georeferencing, therefore you have to 'feed' that to CGA.
the above workflow does that. the only stipulation in this workflow is that the texture shows the same geographic extent as the terrain - which means the terrain you use to get the values should contain all buildings you wanna texture.
cheers!
Hey Matthias,
Thanks for the advice. I'm not sure if this will work. I haven't tried yet, but it seems like this would generate a terrain, which would be under the 3D models of our buildings. What I'm looking to do is drape it over the 3D buildings (not the terrain) as if I'm applying textures to the buildings themselves, but en masse.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.