I was hoping someone in this community would be able to assist with this. I'm building Hangar Models with Rounded roofs and door storage on the side. Is there a way to keep my texture from rotating? The rounded roof is an inserted .obj and the door storage is just extruded on the left and right side of the building. See the image below so you can get an idea of the question. The yellow highlighted areas need to be rotated. I attached my rule file as well.
Hi @BenHammer1,
Currently you do the setupProtjection() at the end of the chain in your X rule so depending on the face from where you call X the texture will have the right direction or not.
I see two ways to approach this:
Hope this helps!
Cheers
Jonas
Adding to what Jonas suggested, for option 2, I'd also recommend putting the setupProjection in HangarFront before the facade is split, as shown below.
To get the texture alignment so the bricks are horizontal, you could use alignScopeToGeometry to align the scope to the lowest edge (which happens to be horizontal in your case) before using setupProjection.
I added a rotateScope after the extrude in HangarDoorStorage just to make it more intuitive to select the appropriate faces in the subsequent comp, but this is optional.
Here is what I changed in your code above.
const facadeTexWidth = 15
const facadeTexHeight = 15
HangarFront -->
setupProjection(0, scope.xy, facadeTexWidth, facadeTexHeight)
split(x) { 4: X
| ~3: split(y) { ~10: Door | 5: X }
| 4: X }
HangarDoorStorage -->
extrude(10)
rotateScope(-90, 0, 0)
comp(f) { top: setupProjection(0, scope.xy, facadeTexWidth, facadeTexHeight) X
| side: Wall_AlignToLowestAndTexture }
RoundedRoofComp -->
comp(f) { object.back: X
| object.front: Wall_AlignToLowestAndTexture
| object.top: Y }
Wall_AlignToLowestAndTexture -->
alignScopeToGeometry(zUp, any, world.lowest)
setupProjection(0, scope.xy, facadeTexWidth, facadeTexHeight)
X
X -->
texture("builtin:uvtest.png")
projectUV(0)