Random texture objects

637
1
12-12-2016 08:47 AM
AntoniaWeber
New Contributor

Hi.

In Cityengine I have several 3D objects and may texture them over Shapes-Texture-Shapes. But if I wanted to automatically choose a random texture individually for each object, how could I do so?

Thank you!

0 Kudos
1 Reply
ThomasFuchs
Esri Regular Contributor

Hi Antonia.

This task can be automated by applying this CGA rule to the shapes:

assets = "/ESRI.lib/assets/Facades/International/Upperfloors/*.jpg"

Lot -->
     comp(f) {all: Face}

Face -->
     setupProjection(0, scope.xy, '1, '1)
     texture(imageBestRatio(assets, "xy"))
     projectUV(0)

Just set the path to your texture asset folder.

0 Kudos