Hi,
I'm trying to texture streets in my model. I'm using the street data from Open Streetmap. There are different street types (residential, primary, secondary, cycleway, footway etc.) which I want to texture differently. However, at the crossings of the streets I can only apply one way of texturing. So at the moment all of the crossing have an asphalt texture, even at footways and residential streets, which are not textured with asphalt. Is there a way to make the texture of the crossings dependent of the streets? This is the rule that I'm using:
const avgLanewidth = 6
attr highway = ""
attr type = ""
attr shapeType = ""
width = case type == "MAJOR": 4
else : 4
calcLanes(width) = width / ceil(width / avgLanewidth) + 0.1
@StartRule
Street -->
comp(f){ all: StreetPart }
StreetPart -->
case shapeType == "Sidewalk" && highway == "residential": Sidewalk
case shapeType == "Crossing":Crossing
case highway =="primary" || highway =="primary_link" : setupProjection(0,scope.yx,3.5,3) projectUV(0) texture("Asphalt.png")
case highway =="secondary" || highway =="secondary_link" :setupProjection(0,scope.yx,3.5,3) projectUV(0) texture("Asphalt.png")
case highway =="tertiary" : setupProjection(0,scope.yx,3.5,3) projectUV(0) texture("Asphalt2.png")
case highway =="path" : setupProjection(0,scope.yx,3.5,3) projectUV(0) texture("Path.png")
case highway =="residential" : setupProjection(0,scope.yx,1,1) projectUV(0) texture("Straatstenen.png")
case highway =="service" : setupProjection(0,scope.yx,1,1) projectUV(0) texture("Straatstenen.png")
case highway =="footway" : setupProjection(0,scope.yx,3,2) projectUV(0) texture("Path.png")
case highway =="cycleway": setupProjection(0,scope.yx,3,2) projectUV(0) texture("Cycleway.png")
case highway =="unclassified": setupProjection(0,scope.yx,1,1) projectUV(0) texture("Straatstenen.png")
case highway =="living_street":setupProjection(0,scope.yx,1,1) projectUV(0) texture("Straatstenen.png")
case highway =="pedestrian":setupProjection(0,scope.yx,3.5,3) projectUV(0) texture("Path.png")
else : case shapeType == "Sidewalk": Sidewalk
else: NIL
@StartRule
JunctionEntry --> Street
@StartRule
Sidewalk --> extrude (0.2) setupProjection(0,scope.xz,2,2) projectUV(0) texture("Stoep.png")
@StartRule
Junction --> color("#aaaaaa")
@StartRule
Crossing--> setupProjection(0,scope.yx,3.5,3) projectUV(0) texture("Asphalt2.png")