How to use CGA to solve the question of sharing one UV for the whole wall texture

510
2
Jump to solution
08-16-2022 10:59 PM
chezhaoli
New Contributor II

Hello everyone, I'm a newbie. When I used CGA to create a 3D model in city engine, I encountered a problem, how to make different textures on a wall share one UV. Looking forward to your reply.

Usually, a face has one UV map

chezhaoli_0-1660715632701.png

But now I want to make them share one same UV.liike this

chezhaoli_1-1660715970875.png

 

How to deal with it .I hope someone could give me some suggestions.Thanks

 

0 Kudos
1 Solution

Accepted Solutions
Houskan
Esri Contributor

Hi chezhaoli,

Working with UVs typically includes two parts:

  1. setupProjection() -> Defines the UV coordinate space
  2. projectUV() -> Applies the UV coordinates

Step 1 is typically done early, before the facade is split. This ensures a global UV coordinate space. Step 2 is then done within the rule where you want to apply your specific texture  (i.e., Windows, Walls, etc.)

To illustrate on a simple example:

 

FacadeTex--> 
    setupProjection(0, scope.xy, '1, '1) // (1) define UV coordinate space over the whole facade
    Facade

Facade --> split(y) { floor_height : Floor }*
Floor --> split(x) { tile_width : Tile }*

Tile--> 
   texture("my_texture_file.jpg")
   projectUV(0) // (2) Apply the UV coordinates 

 

 

For more information about facade modeling and texturing check out Tutorial 7. I think the tutorial covers exactly what you are looking for.

Best,
Niklaus

View solution in original post

0 Kudos
2 Replies
Houskan
Esri Contributor

Hi chezhaoli,

Working with UVs typically includes two parts:

  1. setupProjection() -> Defines the UV coordinate space
  2. projectUV() -> Applies the UV coordinates

Step 1 is typically done early, before the facade is split. This ensures a global UV coordinate space. Step 2 is then done within the rule where you want to apply your specific texture  (i.e., Windows, Walls, etc.)

To illustrate on a simple example:

 

FacadeTex--> 
    setupProjection(0, scope.xy, '1, '1) // (1) define UV coordinate space over the whole facade
    Facade

Facade --> split(y) { floor_height : Floor }*
Floor --> split(x) { tile_width : Tile }*

Tile--> 
   texture("my_texture_file.jpg")
   projectUV(0) // (2) Apply the UV coordinates 

 

 

For more information about facade modeling and texturing check out Tutorial 7. I think the tutorial covers exactly what you are looking for.

Best,
Niklaus

0 Kudos
chezhaoli
New Contributor II

Thanks for your help!I solved this problem~Sorry for taking so long to reply.

0 Kudos