Select to view content in your preferred language

Mapping shapes from attributes

874
3
02-21-2013 04:51 AM
amamalalalalal
Emerging Contributor
Hi,

I want to mapped my shapes with differents representations, for example, i have shapes "parklands" which is divided into "forest", "garden", "flowers" ...., and i want to mapped these diferent area with images
I am sorry if the question has been already posted, i didnt found answer.

Furthermore, how can i do a request to select models generated from a procedural rule?
For example i want to select all the tree defined by Palm with the height>10 m, and select the model 3d and not the initial shape.

Thanks a lot.
0 Kudos
3 Replies
MatthiasBuehler1
Deactivated User
Hi !


To map textures based on the zone attribute, initialize that object attribute in CGA, then use it in the texture call.

E.g.

@Range ("forest", "garden", "flowers")
attr myVegetationZone = "" # Point this to the object attribute !

Lot -->
    setupProjection(0, scope.xz, 5, 5)
    projectUV(0)
    texture ( fileRandom( "assets/folder/" + myVegetationZone  + "*jpg")



Selecting by attribute must be done via Python currently. You have CityEngine Advanced ?

What's the reason why you want to specifically select Models ?
0 Kudos
amamalalalalal
Emerging Contributor
Hi,

Thanks for the code it works fine.
But if i want to mapped for example the roads is it possible to follow the line and rotate uv, maybe it better works with the street graphs? I have CE Advanced yes.

Thanks for the code it is very interesting
Aurelien
0 Kudos
MatthiasBuehler1
Deactivated User
you mean texturing street shapes so the texture follows the curvature ?

then you don't need the UV setup because all shapes produced by the 'Dynamic City Layouts' system already have UVs.
Street -->
    tileUV(0, ~5, ~5)
    texture("builtin:uvtest.png")
0 Kudos