<?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 Street texture in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87379#M1213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Zaldan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Matt!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have another texture question... different issue I think. The textures look weird on the streets (the textures on the building models are fine) this is after I made a new scene in which the model is geolocated (far from the center). Could this have something to do with it? Other than that there are no changes and it was working fine before. I'm also using a better computer from the one I was having problems with previously.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if it is something obvious or not. Otherwise I am very pleased with CE2011 &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;I'm attaching an image with the builtin uv test applied, with the texture applied and the texture map itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2011 22:47:16 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2011-12-20T22:47:16Z</dc:date>
    <item>
      <title>Street texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87379#M1213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Zaldan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Matt!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have another texture question... different issue I think. The textures look weird on the streets (the textures on the building models are fine) this is after I made a new scene in which the model is geolocated (far from the center). Could this have something to do with it? Other than that there are no changes and it was working fine before. I'm also using a better computer from the one I was having problems with previously.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if it is something obvious or not. Otherwise I am very pleased with CE2011 &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;I'm attaching an image with the builtin uv test applied, with the texture applied and the texture map itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 22:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87379#M1213</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-12-20T22:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Street texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87380#M1214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey there !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this could indeed be an issue with the scene coordinate system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you check the code whether the UV projection of the color texture contains 'world' ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setupProjection(0, world.xz, 586, 442)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lemme kno-hooow. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 07:45:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87380#M1214</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2011-12-21T07:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Street texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87381#M1215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Zaldan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does, actually - the code looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;StreetTexture(size) --&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; setupProjection(0,world.xz,size,size,0.2) projectUV(0) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; setupProjection(2,world.xz,size*5,size*5,0.2) projectUV(2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; texture(streettex)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; set(material.dirtmap, dirttex) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the same scene I tried creating a new street network at the center and applied the rule - textures looked fine. The shape generation had problems near the origin though. Seems like the whole model is in one coordinate system and the street texture is in another...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and happy pre-holidays &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2011 21:56:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87381#M1215</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-12-21T21:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Street texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87382#M1216</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;I can reproduce it too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have forwarded it to the devs, ok ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll let you know what this is about precisely. I have the feeling, but only they know for sure .. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;chocolate cheers !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2011 11:55:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87382#M1216</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2011-12-22T11:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Street texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87383#M1217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: decrement&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Zaldan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;your suspicion was right - the model generation happens in a local coordinate system and is immune to numerical problems due to large coordinates. In contrast, the "world" selector in the setupProjection() operation forces the usage of absolute "CityEngine CS" coordinates which can give numerical problems if coordinates are large (6 digits or larger).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are two workarounds which should help you achieve your goals:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Workaround 1: &lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Align the scope to the CityEngine CS coordinate axes&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;use scope-relative setupProjection and add an offset based on the global position&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr streettex = "builtin:uvtest.png"

texOffsetX(size) = getGeoCoord(X) % size
texOffsetZ(size) = -getGeoCoord(Y) % size

StreetTexture2(size) --&amp;gt;
 alignScopeToAxes()
 setupProjection(0,scope.xz,size,size, -texOffsetX(size), -texOffsetZ(size)) 
 projectUV(0)
 texture(streettex) 
&lt;/PRE&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Workaround 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;align the scope to the CityEngine CS coordinate axes&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;use scope-relative setupProjection &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;translate the uv coordinates (after projection!) by an offset based on the global position&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr streettex = "builtin:uvtest.png"

texOffsetX(size) = getGeoCoord(X) % size
texOffsetZ(size) = -getGeoCoord(Y) % size
 
StreetTexture3(size) --&amp;gt;
 alignScopeToAxes()
 setupProjection(0,scope.xz,size,size) projectUV(0)
 translateUV(0, texOffsetX(size) / size, texOffsetZ(size) / size)
 texture(streettex)
&lt;/PRE&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Workaround 1 is preferable because it encodes the translation into the projection matrix, while in workaround 2 the offset gets added to the texture coordinates of every vertex. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Both approaches work if you use a meter-based coordinate system. If your scene coordinate system is&amp;nbsp; feet-based, you need to account for that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;[INDENT]
const f2m = 0.3047996&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
texOffsetX(size) = (getGeoCoord(X)*f2m) % size
texOffsetZ(size) = (-getGeoCoord(Y)*f2m) % size
&lt;/PRE&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason is that everything in CGA happens in the meter-based CityEngine CS - but the getGeoCoord() function is bound to the selected coordinate system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope that sets you up&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;greetings&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Decrement&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:20:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87383#M1217</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T23:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Street texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87384#M1218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you. Workaround 2 actually was better for me because it tiles the textures properly, whereas #1 kept the texture size as '1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 00:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/street-texture/m-p/87384#M1218</guid>
      <dc:creator>MarieSaldana1</dc:creator>
      <dc:date>2012-01-04T00:28:44Z</dc:date>
    </item>
  </channel>
</rss>

