<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Texture projection - keeping textures vertically orientated in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183671#M2471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you as a user to be so patient with us !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's great to see users getting used to CGA and actually accomplish things !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;not every person is interested in scripting, we know, that's why we'll be working more on rule templates which should make the lifes of non-tekkies easier !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2012 15:31:53 GMT</pubDate>
    <dc:creator>MatthiasBuehler1</dc:creator>
    <dc:date>2012-04-18T15:31:53Z</dc:date>
    <item>
      <title>Texture projection - keeping textures vertically orientated</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183667#M2467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13544[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Howdy - I'm hoping you can help.&amp;nbsp; At the moment, I'm figuring out how to keep a texture vertically aligned, but projected flat onto a face.&amp;nbsp; Normally, the rules I've put together below work fine, but (from what I read) it seems that faces without a horizontal edge at the bottom... give problems to the texture rotation.&amp;nbsp; As you'll see from the photo, upside down triangles* are the issue, so the texture is projected flat (good) but rotated a bit skewed (which is bad) on that face (... it seems to be aligned with an edge).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is clear that you have solved this in the NYC 2259 example, but there is a lot of wizardry that I don't quite understand.&amp;nbsp; Is there a more simple way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;BR /&gt;* It may be obvious to some, but for those who are puzzled, the triangles are caused by an imported shape that is formed from two pyramids, one inverted into the other.&amp;nbsp; Those faces don't LOOK triangular, but the rest of the face is inside the structure so it is actually an upside down triangle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]13535[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;################################ # FILES import flatroof&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : "flatroof.cga"&amp;nbsp;&amp;nbsp; ################################ # ATTRIBUTES attr LOD = 2 attr finalBuildingHeight = 100 attr floorH = rand(5,6) attr tileW&amp;nbsp; = rand(2.2,3.7)&amp;nbsp; ################################ # FUNCTIONS getWallATex&amp;nbsp;&amp;nbsp;&amp;nbsp; = "facades/facade1_color.png" getFloorHeight(h)&amp;nbsp;&amp;nbsp; = case h &amp;gt;= floorH&amp;nbsp; : h/rint(h/floorH)&amp;nbsp; else : scope.sy/ceil(scope.sy/floorH+0.0001) getTileWidth(w)&amp;nbsp;&amp;nbsp; = case w &amp;gt;= tileW&amp;nbsp; : w/rint(w/tileW)&amp;nbsp; else : scope.sx/ceil(scope.sx/tileW+0.0001)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ################################ # RULES Lot --&amp;gt;&amp;nbsp; Footprint&amp;nbsp;&amp;nbsp; Footprint --&amp;gt;&amp;nbsp; s('0.9,'1,'0.9)&amp;nbsp;&amp;nbsp; center(xz)&amp;nbsp;&amp;nbsp; alignScopeToAxes(y)&amp;nbsp;&amp;nbsp; s('1,0,'1)&amp;nbsp; Mass&amp;nbsp; Mass --&amp;gt;&amp;nbsp; extrude(finalBuildingHeight)&amp;nbsp; Shapes&amp;nbsp; Shapes --&amp;gt;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/cube_slanted_edges2.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/cyl24_ver_bevel.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/cyl8_ver.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof }&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/o_shape.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/prism1.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/cube_taper_steps1.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof }&amp;nbsp; 10%: &amp;nbsp; i( "volumes/u_shape.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/cube_translated2.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; 10%: &amp;nbsp; i( "volumes/cube_slanted_faces1.obj" ) &amp;nbsp; comp(f){ side : Facade | horizontal : Roof } &amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp; NIL&amp;nbsp; Roof --&amp;gt; &amp;nbsp; GetToItLater.&amp;nbsp;&amp;nbsp; Facade --&amp;gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; alignScopeToGeometry(zUp, auto) &amp;nbsp;&amp;nbsp; texture(getWallATex)&amp;nbsp; &amp;nbsp;&amp;nbsp; setupProjection(0, scope.xy, 16*getTileWidth(scope.sx), 16*getFloorHeight(scope.sy), 1)&amp;nbsp; &amp;nbsp;&amp;nbsp; projectUV(0) # colormap texture projection &amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2012 16:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183667#M2467</guid>
      <dc:creator>DavidOConnor</dc:creator>
      <dc:date>2012-04-15T16:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Texture projection - keeping textures vertically orientated</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183668#M2468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yep, this is a famous problem. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the issue is that there's no 'lowest horizontal edge' to align to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thus, the easiest way to solve this issue is to split off a tiny fraction of the shape which will give you this lowest edge :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;alignScopeToAxes(y) split(y) {0.01 : X. | ~1 : Y.}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then on the Y shape, you can align to the lowest edge and continue texturing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know, this is not a beautiful solution, but currently, it's the easiest. I'll dig a little deeper if there's a better option available.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ok ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 15:00:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183668#M2468</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-04-17T15:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Texture projection - keeping textures vertically orientated</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183669#M2469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;btw. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of 10 times 10% case statement, you could also use :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;i ( fileRandom("volumes/*.obj"))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 15:03:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183669#M2469</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-04-17T15:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Texture projection - keeping textures vertically orientated</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183670#M2470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: WhiteNorthStar&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hi Matthias, thank you for your quick responses, that is very helpful &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, I'm getting to grips with CGA shape grammar.&amp;nbsp; It is really powerful and easy to use... genius work!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 12:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183670#M2470</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-04-18T12:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Texture projection - keeping textures vertically orientated</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183671#M2471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you as a user to be so patient with us !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's great to see users getting used to CGA and actually accomplish things !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;not every person is interested in scripting, we know, that's why we'll be working more on rule templates which should make the lifes of non-tekkies easier !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 15:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/texture-projection-keeping-textures-vertically/m-p/183671#M2471</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-04-18T15:31:53Z</dc:date>
    </item>
  </channel>
</rss>

