It would be pretty useful for scatter operations.
using City Engine? perhaps you might want to move this to a more appropriate place like maybe Spatial Analyst or similar
Yes, this is CE-specific. Sampling the terrain isn't an issue if the models are converted into static shapes, but I need them to stay dynamic.
You can get the terrain elevation by connecting a rule attribute to the terrain elevation (click on drop down arrow next to rule attribute in Inspector -> Connect Attribute -> Layer Attribute -> select terrain layer and elevation attribute).
That's only for the initial shape, no? When you have a large polygon, read the height and translate scattered models, you end up with this:
What I'm asking is if I could create the scene below, without having to bake in the xz coordinates (I just created quads, then converted them to shape, seperated the result and assigned a primitiveCube rule; the shapes are all at y = 0:
Yes, accessing the terrain elevation through the layer attribute only works for the initial shape.
There's no way to access the terrain elevation from within cga.
The workaround to get what you have in the second image is not ideal. You could write a rule to split the polygon into grid cells in cga (need to choose a resolution), convert models to shapes, then align shapes to terrain. Then you have an initial shape that follows the terrain.
That's what I'd usually do, except that I generate triangles. However this is not exactly ideal either and results in floating models on steep terrain (unless the mesh is so dense that CE chokes..). Proper scattering is also not possible since the resulting shape slivers aren't connected after the split.
Retrieving data ...