qingyang

Can CGA be efficient and pithy for different building types?

Discussion created by qingyang on May 21, 2014
Latest reply on May 28, 2014 by BTLeslie
Hi,
  I have 30 types of buildings and each type of them have many buildings. I classify buildings with the attribution class1, class2, class3... What's more, I have many different textures. Now I want to give each type of buildings the same texture.
  Now this is what I can do:
  lot-->
     case buildingType == "class1": buildingTex1
     case buildingType == "class2": buildingTex2
     case buildingType == "class3": buildingTex3
     ...
  buildingTex1-->
    setupProjection(0,scope.xy,~7,~3,0)
    texture("assets/texture/facade2/CRBuilding_1.jpg")
    projectUV(0)
  ...
  You can see that I have to do similar things for many times. The texture can be random for different types of the buildings, but it should keep the same texture in the same type of the buildings. The "buildingType" and "buildingTex" are regular, so can I use a pithy method to do this work?
  thanks

Outcomes